fixed problem with 'boolean' typedef when compiling with MinGW environment
authorHolger Schemel <info@artsoft.org>
Mon, 19 Mar 2018 19:02:43 +0000 (20:02 +0100)
committerHolger Schemel <info@artsoft.org>
Fri, 23 Mar 2018 20:15:03 +0000 (21:15 +0100)
A typedef named "boolean" (but defined as "unsigned char", not "int") is
already defined in one of the Windows header files, so it was redefined to
a non-conflicting name to prevent collisions when compiling for the Windows
platform.

src/libgame/types.h
src/libgame/windows.h

index acc2c236f35a3f06ba434e90c973015bb9bcaa63..1278a553a6418c85f6ee2f1bde885f78ca8594fa 100644 (file)
@@ -18,9 +18,9 @@
 #include <string.h>
 #include <sys/types.h>
 
 #include <string.h>
 #include <sys/types.h>
 
-typedef int boolean;
 
 #if !defined(PLATFORM_WIN32)
 
 #if !defined(PLATFORM_WIN32)
+typedef int boolean;
 typedef unsigned char byte;
 #endif
 
 typedef unsigned char byte;
 #endif
 
index 30273488a8892c29fb70ecee41acb1af9124ebb5..a3d68cc470e21033d11ee04219f1b3a444ac48bb 100644 (file)
@@ -16,6 +16,9 @@
 
 
 /* some symbols are already defined on Windows */
 
 
 /* some symbols are already defined on Windows */
+typedef int boolean_internal;
+#define boolean boolean_internal
+
 #define CreateBitmap CreateBitmap_internal
 #define GetPixel GetPixel_internal
 #define CloseWindow CloseWindow_internal
 #define CreateBitmap CreateBitmap_internal
 #define GetPixel GetPixel_internal
 #define CloseWindow CloseWindow_internal