X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e19291405ff3995a32c965da9694f2f20aa02468..b132a83bffa4f9855fb02c7c82d48cee33a69b1a:/src/jpeg/jmorecfg.h diff --git a/src/jpeg/jmorecfg.h b/src/jpeg/jmorecfg.h index 54a7d1c447..c4a5d33b08 100644 --- a/src/jpeg/jmorecfg.h +++ b/src/jpeg/jmorecfg.h @@ -130,6 +130,7 @@ typedef char JOCTET; */ /* UINT8 must hold at least the values 0..255. */ +#ifndef __WINE_BASETSD_H #ifdef HAVE_UNSIGNED_CHAR typedef unsigned char UINT8; @@ -155,11 +156,21 @@ typedef unsigned int UINT16; typedef short INT16; #endif +#endif /* __WINE_BASETSD_H */ + /* INT32 must hold at least signed 32-bit values. */ -#ifndef XMD_H /* X11/xmd.h correctly defines INT32 */ -typedef long INT32; -#endif +/* + VZ: due to the horrible mess resulting in INT32 being defined in windows.h + for some compilers but not for the other ones, I have globally replace + INT32 with JPEG_INT32 in libjpeg code to avoid the eight level ifdef + which used to be here. The problem is that, of course, now we'll have + conflicts when upgrading to the next libjpeg release -- however + considering their frequency (1 in the last 5 years) it seems that + it is not too high a price to pay for the clean compilation with all + versions of mingw32 and cygwin + */ +typedef long JPEG_INT32; /* Datatype used for image dimensions. The JPEG standard only supports * images up to 64K*64K due to 16-bit fields in SOF markers. Therefore @@ -180,15 +191,29 @@ typedef unsigned int JDIMENSION; * or code profilers that require it. */ +#if defined(__VISAGECPP__) +#define JPEG_CALLING_CONV _Optlink +#else /* !Visual Age C++ */ +#define JPEG_CALLING_CONV +#endif + +/* We can't declare a static function as extern "C" as we need to do in C++ + * programs, so suppress static in METHODDEF when using C++. + */ +#if defined(__cplusplus) +#define JPEG_METHOD_LINKAGE +#else /* !__cplusplus */ +#define JPEG_METHOD_LINKAGE static +#endif + /* a function called through method pointers: */ -#define METHODDEF(type) static type +#define METHODDEF(type) JPEG_METHOD_LINKAGE type JPEG_CALLING_CONV /* a function used only in its module: */ -#define LOCAL(type) static type +#define LOCAL(type) static type JPEG_CALLING_CONV /* a function referenced thru EXTERNs: */ #define GLOBAL(type) type /* a reference to a GLOBAL function: */ -#define EXTERN(type) extern type - +#define EXTERN(type) extern type JPEG_CALLING_CONV /* This macro is used to declare a "method", that is, a function pointer. * We want to supply prototype parameters if the compiler can cope. @@ -196,12 +221,22 @@ typedef unsigned int JDIMENSION; * Again, you can customize this if you need special linkage keywords. */ +#if defined(__VISAGECPP__) /* need this for /common/imagjpeg.obj but not loclly */ +#ifdef HAVE_PROTOTYPES +#define JMETHOD(type,methodname,arglist) type (_Optlink *methodname) arglist +#else +#define JMETHOD(type,methodname,arglist) type (_Optlink *methodname) () +#endif + +#else + #ifdef HAVE_PROTOTYPES #define JMETHOD(type,methodname,arglist) type (*methodname) arglist #else #define JMETHOD(type,methodname,arglist) type (*methodname) () #endif +#endif /* Here is the pseudo-keyword for declaring pointers that must be "far" * on 80x86 machines. Most of the specialized coding for 80x86 is handled @@ -212,8 +247,10 @@ typedef unsigned int JDIMENSION; #ifdef NEED_FAR_POINTERS #define FAR far #else +#ifndef FAR #define FAR #endif +#endif /* @@ -223,9 +260,29 @@ typedef unsigned int JDIMENSION; * Defining HAVE_BOOLEAN before including jpeglib.h should make it work. */ +#if 0 #ifndef HAVE_BOOLEAN typedef int boolean; #endif +#endif + +/* + * Notes about boolean above: + * + * The main conflict we see is with the Windows headers of some compilers that + * have a different definition of boolean. Therefore boolean has been replaced + * with wxjpeg_boolean throughout the jpeg sources. The alternative would have + * been to make the definition here the same as the Windows definition. It's + * not enough to just define HAVE_BOOLEAN when using the jpeg library, the + * definition of boolean must match when the jpeg library is compiled too. + * + * System jepg libs won't have this type, of course, so to use test + * HAVE_WXJPEG_BOOLEAN and fall back to boolean when not defined. + */ + +typedef int wxjpeg_boolean; +#define HAVE_WXJPEG_BOOLEAN + #ifndef FALSE /* in case these macros already exist */ #define FALSE 0 /* values of boolean */ #endif