From ca2e96d296eea31670819b1eb11914299a771c72 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 12 Jun 2017 19:46:59 +0200 Subject: [PATCH] Fix for certain libjpeg versions that override INLINE macro --- panda/src/pnmimagetypes/pnmFileTypeJPG.h | 9 +++++++++ panda/src/vision/webcamVideoCursorV4L.h | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/panda/src/pnmimagetypes/pnmFileTypeJPG.h b/panda/src/pnmimagetypes/pnmFileTypeJPG.h index 2dcd506322..b82534189a 100644 --- a/panda/src/pnmimagetypes/pnmFileTypeJPG.h +++ b/panda/src/pnmimagetypes/pnmFileTypeJPG.h @@ -36,6 +36,10 @@ #include #endif +// jconfig.h overrides our INLINE definition. +#ifdef __GNUC__ +#pragma push_macro("INLINE") +#endif extern "C" { #include // jpeglib requires this to be included first. @@ -43,6 +47,11 @@ extern "C" { #include } +// Restore our own INLINE definition. +#ifdef __GNUC__ +#pragma pop_macro("INLINE") +#endif + /** * For reading and writing Jpeg files. */ diff --git a/panda/src/vision/webcamVideoCursorV4L.h b/panda/src/vision/webcamVideoCursorV4L.h index 7eb7b02763..9555096eea 100644 --- a/panda/src/vision/webcamVideoCursorV4L.h +++ b/panda/src/vision/webcamVideoCursorV4L.h @@ -24,9 +24,18 @@ #include #ifdef HAVE_JPEG +// jconfig.h overrides our INLINE definition. +#ifdef __GNUC__ +#pragma push_macro("INLINE") +#endif + extern "C" { #include } + +#ifdef __GNUC__ +#pragma pop_macro("INLINE") +#endif #endif class WebcamVideoV4L;