Browse Source

Try fix MinGW build

LouYihua 7 years ago
parent
commit
5a506bafb2
1 changed files with 24 additions and 24 deletions
  1. 24 24
      common.h

+ 24 - 24
common.h

@@ -26,11 +26,6 @@
 # define PAL_CLASSIC        1
 #endif
 
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
 #if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS)
 #define _CRT_SECURE_NO_WARNINGS
 #endif
@@ -47,9 +42,8 @@ extern "C"
 #include "SDL.h"
 #include "SDL_endian.h"
 
-#ifndef PAL_FATAL_OUTPUT
-# define PAL_FATAL_OUTPUT(s)
-#endif
+#define __WIDETEXT(quote) L##quote
+#define WIDETEXT(quote) __WIDETEXT(quote)
 
 #if !defined(fmax) || !defined(fmin)
 # include <math.h>
@@ -63,6 +57,19 @@ extern "C"
 # define min fmin
 #endif
 
+// For SDL 1.2 compatibility
+#ifndef SDL_TICKS_PASSED
+#define SDL_TICKS_PASSED(A, B)  ((Sint32)((B) - (A)) <= 0)
+#endif
+
+#ifndef SDL_INIT_CDROM
+# define SDL_INIT_CDROM       0	  /* Compatibility with SDL 1.2 */
+#endif
+
+#ifndef SDL_AUDIO_BITSIZE
+# define SDL_AUDIO_BITSIZE(x)         (x & 0xFF)
+#endif
+
 /* This is need when compiled with SDL 1.2 */
 #ifndef SDL_FORCE_INLINE
 #if defined(_MSC_VER)
@@ -139,6 +146,11 @@ typedef const WCHAR        *LPCWSTR;
 
 #endif
 
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
 /* When porting SDLPAL to a new platform, please make a separate directory and put a file 
    named 'pal_config.h' that contains marco definitions & header includes into the directory.
    The example of this file can be found in directories of existing portings.
@@ -165,14 +177,6 @@ typedef const WCHAR        *LPCWSTR;
 # define PAL_HAS_OGG          1   /* Try always enable OGG. If compilation/run failed, please change this value to 0. */
 #endif
 
-#ifndef SDL_INIT_CDROM
-# define SDL_INIT_CDROM       0	  /* Compatibility with SDL 1.2 */
-#endif
-
-#ifndef SDL_AUDIO_BITSIZE
-# define SDL_AUDIO_BITSIZE(x)         (x & 0xFF)
-#endif
-
 #ifndef PAL_CONFIG_PREFIX
 # define PAL_CONFIG_PREFIX PAL_PREFIX
 #endif
@@ -193,18 +197,14 @@ typedef const WCHAR        *LPCWSTR;
 # define PAL_SCALE_SCREEN   TRUE
 #endif
 
-#define __WIDETEXT(quote) L##quote
-#define WIDETEXT(quote) __WIDETEXT(quote)
-
-// For SDL 1.2 compatibility
-#ifndef SDL_TICKS_PASSED
-#define SDL_TICKS_PASSED(A, B)  ((Sint32)((B) - (A)) <= 0)
-#endif
-
 #ifndef PAL_IS_VALID_JOYSTICK
 # define PAL_IS_VALID_JOYSTICK(s)  TRUE
 #endif
 
+#ifndef PAL_FATAL_OUTPUT
+# define PAL_FATAL_OUTPUT(s)
+#endif
+
 typedef enum tagCODEPAGE {
 	CP_MIN = 0,
 	CP_BIG5 = 0,