Skip to content

Commit eed0861

Browse files
committed
Prevent jmorecfg.h from re-defining INT32 and INT16 if those types have already been defined by the Windows system headers.
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@663 632fc199-4ca6-4c93-a231-07263d6284db
2 parents 8c60d22 + b7120ca commit eed0861

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

ChangeLog.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ v7 or v8 emulation or arithmetic coding support was enabled. Note that to
5353
achieve full ABI compatibility with jpeg-6b, it is necessary to build
5454
libjpeg-turbo without arithmetic coding support.
5555

56+
[14] Fixed an issue whereby Windows applications that used libjpeg-turbo would
57+
fail to compile if the Windows system headers were included before jpeglib.h.
58+
This issue was caused by a conflict in the definition of the INT32 type.
59+
5660

5761
1.1.1
5862
=====

win/jconfig.h.in

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ typedef unsigned char boolean;
2525
#endif
2626
#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */
2727

28+
/* Define "INT32" as int, not long, per Windows custom */
29+
#if !(defined(_BASETSD_H_) || defined(_BASETSD_H)) /* don't conflict if basetsd.h already read */
30+
typedef short INT16;
31+
typedef signed int INT32;
32+
#endif
33+
#define XMD_H /* prevent jmorecfg.h from redefining it */
34+
2835
#define inline __inline
2936

3037
#ifdef JPEG_INTERNALS

0 commit comments

Comments
 (0)