Avoid build error caused by conflicting types for INT32

Compiler error for cross builds using mingw-w64:

In file included from /usr/share/mingw-w64/include/winnt.h:150,
                 from /usr/share/mingw-w64/include/minwindef.h:163,
                 from /usr/share/mingw-w64/include/windef.h:9,
                 from /usr/share/mingw-w64/include/windows.h:69,
                 from /usr/share/mingw-w64/include/winsock2.h:23,
                 from ../../../server/spice-core.h:29,
                 from ../../../server/spice.h:24,
                 from ../../../server/spice-wrapped.h:35,
                 from ../../../server/red-common.h:35,
                 from ../../../server/jpeg-encoder.c:22:
/usr/share/mingw-w64/include/basetsd.h:31:22: error: conflicting types for ‘INT32’
   typedef signed int INT32,*PINT32;
                      ^~~~~
In file included from /usr/x86_64-w64-mingw32/sys-root/mingw/include/jpeglib.h:31,
                 from ../../../server/jpeg-encoder.c:20:
/usr/x86_64-w64-mingw32/sys-root/mingw/include/jmorecfg.h:179:14: note: previous declaration of ‘INT32’ was here
 typedef long INT32;
              ^~~~~

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Acked-by: Frediano Ziglio <freddy77@gmail.com>
This commit is contained in:
Stefan Weil 2021-04-08 12:27:13 +02:00 committed by Frediano Ziglio
parent 6e299f5081
commit 691bd67ff8
3 changed files with 11 additions and 0 deletions

View File

@ -79,5 +79,6 @@ Patches also contributed by
Rosen Penev <rosenp@gmail.com>
James Le Cuirot <chewi@gentoo.org>
Frediano Ziglio <freddy77@gmail.com>
Stefan Weil <sw@weilnetz.de>
....send patches to get your name here...

View File

@ -16,6 +16,11 @@
*/
#include <config.h>
#ifdef _WIN32
/* Avoid conflicting types for INT32 */
#define QGLOBAL_H
#endif
#include <stdio.h>
#include <jpeglib.h>

View File

@ -17,6 +17,11 @@
*/
#include <config.h>
#ifdef _WIN32
/* Avoid conflicting types for INT32 */
#define QGLOBAL_H
#endif
#include <stdio.h>
#include <inttypes.h>
#include <jerror.h>