diff --git a/panda/src/pnmimagetypes/pnmFileTypeJPG.h b/panda/src/pnmimagetypes/pnmFileTypeJPG.h index 2dcd506322..60afc861d0 100644 --- a/panda/src/pnmimagetypes/pnmFileTypeJPG.h +++ b/panda/src/pnmimagetypes/pnmFileTypeJPG.h @@ -37,11 +37,17 @@ #endif +// jpeglib sometimes redefines the INLINE macro and breaks inlining +// (on e.g. Ubuntu 12.04) so we need to preserve it somehow - this uses the +// MSVC push_macro/pop_macro pragmas, which are also supported on GCC and +// Clang, but may not be cross-compiler enough to merge up to master. Hrm. :/ +#pragma push_macro("INLINE") extern "C" { #include // jpeglib requires this to be included first. #include #include } +#pragma pop_macro("INLINE") /** * For reading and writing Jpeg files.