From ec31953007126a6e0f9f3ca16b64bdfdcdf3d7b6 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 21 Nov 2018 11:25:57 -0800 Subject: Fix build using Windows SDK 10.0.17763 c:\qt\qt5\qtbase\src\3rdparty\libjpeg\src\jmorecfg.h(242): error C2371: 'boolean': redefinition; different basic types c:\program files (x86)\windows kits\10\include\10.0.17763.0\shared\rpcndr.h(193): note: see declaration of 'boolean' Instead of trying to guess if a certain header has been #included and whether that header does typedef something to boolean, let's just use the preprocessor to hide, like some people do for X11/Xlib.h's Bool (see qmetatype.h where we refused). Change-Id: I05b8d7ba19004af99f3cfffd15693a87e175f05d Reviewed-by: Eirik Aavitsland --- src/plugins/imageformats/jpeg/qjpeghandler.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/plugins/imageformats') diff --git a/src/plugins/imageformats/jpeg/qjpeghandler.cpp b/src/plugins/imageformats/jpeg/qjpeghandler.cpp index e52a19703c..54fe857908 100644 --- a/src/plugins/imageformats/jpeg/qjpeghandler.cpp +++ b/src/plugins/imageformats/jpeg/qjpeghandler.cpp @@ -56,13 +56,12 @@ // including jpeglib.h seems to be a little messy extern "C" { -// mingw includes rpcndr.h but does not define boolean -#if defined(Q_OS_WIN) && defined(Q_CC_GNU) -# if defined(__RPCNDR_H__) && !defined(boolean) - typedef unsigned char boolean; -# define HAVE_BOOLEAN -# endif +// jpeglib.h->jmorecfg.h tries to typedef int boolean; but this conflicts with +// some Windows headers that may or may not have been included +#ifdef HAVE_BOOLEAN +# undef HAVE_BOOLEAN #endif +#define boolean jboolean #define XMD_H // shut JPEGlib up #include -- cgit v1.2.3