Browse Source

png fixes

David Rose 17 years ago
parent
commit
8f8d56b530

+ 8 - 0
panda/src/pnmimagetypes/config_pnmimagetypes.h

@@ -16,6 +16,14 @@
 #define CONFIG_PNMIMAGETYPES_H
 #define CONFIG_PNMIMAGETYPES_H
 
 
 #include "pandabase.h"
 #include "pandabase.h"
+
+#ifdef HAVE_PNG
+// If we are going to be including png.h (in the unrelated file
+// pnmFileTypePNG.h), be sure to include it before including setjmp.h.
+// Ugly hack due to png weirdness with setjmp.
+#include <png.h>
+#endif
+
 #include "notifyCategoryProxy.h"
 #include "notifyCategoryProxy.h"
 #include "configVariableInt.h"
 #include "configVariableInt.h"
 #include "configVariableString.h"
 #include "configVariableString.h"

+ 3 - 2
panda/src/pnmimagetypes/pnmFileTypePNG.h

@@ -19,12 +19,13 @@
 
 
 #ifdef HAVE_PNG
 #ifdef HAVE_PNG
 
 
+// Must be first.
+#include <png.h>
+
 #include "pnmFileType.h"
 #include "pnmFileType.h"
 #include "pnmReader.h"
 #include "pnmReader.h"
 #include "pnmWriter.h"
 #include "pnmWriter.h"
 
 
-#include <png.h>
-
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //       Class : PNMFileTypePNG
 //       Class : PNMFileTypePNG
 // Description : For reading and writing PNG files.
 // Description : For reading and writing PNG files.