[BUGFIX] INT32 redefinition

In the juce_graphics/image_formats/jpglib/jmorecfg.h, update

/* INT32 must hold at least signed 32-bit values. */
#ifndef XMD_H			/* X11/xmd.h correctly defines INT32 */
typedef long INT32;
#endif

to

/* INT32 must hold at least signed 32-bit values. */
#ifndef XMD_H /* X11/xmd.h correctly defines INT32 */
    #ifndef _BASETSD_H_ /* Microsoft defines it in basetsd.h */
        #ifndef _BASETSD_H /* MinGW is slightly different */
            #ifndef QGLOBAL_H /* Qt defines it in qglobal.h */
typedef long INT32;
            #endif
        #endif
    #endif
#endif

Otherwise this throws redefinition errors with the win 10 sdk.
Globally defining INT32 seems like a very bad idea but thats jpglib code and wasnt written by the juce team…

1 Like

Good catch and definitely a smell.

Targeting x64 and Win32, and building the DemoRunner on Windows 10 with VS2022, I don’t see warnings with SDKs 10.0.18362.0, 10.0.19041.0, 10.0.20348.0, 10.0.22000.0, or 10.0.22621.0.

Please provide the following information, so that we can reproduce the problem and verify the solution:

  • Do you see the problem building any of the JUCE example projects? If so, which ones?
  • With which SDK version are you building?
  • What platform are you targeting?
  • What compiler/toolchain version are you using?
  • Are you using Projucer or CMake?