diff --git a/ChangeLog b/ChangeLog index 97d40f8ec..bdf3679e6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-02-08 Riccardo Mottola + + * Source/NSBitmapImageRep+PNG.m: + Tweak png.h header order to avoid problems on some systems. + 2011-02-08 Riccardo Mottola * Source/NSBitmapImageRep+PNG.m: diff --git a/Source/NSBitmapImageRep+PNG.m b/Source/NSBitmapImageRep+PNG.m index 41de78421..0cb24d79c 100644 --- a/Source/NSBitmapImageRep+PNG.m +++ b/Source/NSBitmapImageRep+PNG.m @@ -29,14 +29,8 @@ #import "config.h" -#import -#import -#import -#import -#import -#import "AppKit/NSGraphics.h" -#import "NSBitmapImageRep+PNG.h" - +/* we include PNG stuff only if required and before the resto to avoid header and + redeclaration problems (setjmp, etc) */ #ifdef HAVE_LIBPNG #include @@ -52,6 +46,20 @@ # define PNG_gAMA 0 #endif +#endif /* HAVE_LIBPNG */ + +/* we import all the standard headers to allow compilation without PNG */ +#import +#import +#import +#import +#import +#import "AppKit/NSGraphics.h" +#import "NSBitmapImageRep+PNG.h" + + +#ifdef HAVE_LIBPNG + @implementation NSBitmapImageRep (PNG) + (BOOL) _bitmapIsPNG: (NSData *)imageData