diff --git a/panda/src/pnmimagetypes/config_pnmimagetypes.h b/panda/src/pnmimagetypes/config_pnmimagetypes.h index c6a3a38a29..fb1c76d74d 100644 --- a/panda/src/pnmimagetypes/config_pnmimagetypes.h +++ b/panda/src/pnmimagetypes/config_pnmimagetypes.h @@ -16,6 +16,14 @@ #define CONFIG_PNMIMAGETYPES_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 +#endif + #include "notifyCategoryProxy.h" #include "configVariableInt.h" #include "configVariableString.h" diff --git a/panda/src/pnmimagetypes/pnmFileTypePNG.h b/panda/src/pnmimagetypes/pnmFileTypePNG.h index 9f32cb3769..9015f57d6b 100755 --- a/panda/src/pnmimagetypes/pnmFileTypePNG.h +++ b/panda/src/pnmimagetypes/pnmFileTypePNG.h @@ -19,12 +19,13 @@ #ifdef HAVE_PNG +// Must be first. +#include + #include "pnmFileType.h" #include "pnmReader.h" #include "pnmWriter.h" -#include - //////////////////////////////////////////////////////////////////// // Class : PNMFileTypePNG // Description : For reading and writing PNG files.