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
 # define PAL_CLASSIC        1
 #endif
 #endif
 
 
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
 #if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS)
 #if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS)
 #define _CRT_SECURE_NO_WARNINGS
 #define _CRT_SECURE_NO_WARNINGS
 #endif
 #endif
@@ -47,9 +42,8 @@ extern "C"
 #include "SDL.h"
 #include "SDL.h"
 #include "SDL_endian.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)
 #if !defined(fmax) || !defined(fmin)
 # include <math.h>
 # include <math.h>
@@ -63,6 +57,19 @@ extern "C"
 # define min fmin
 # define min fmin
 #endif
 #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 */
 /* This is need when compiled with SDL 1.2 */
 #ifndef SDL_FORCE_INLINE
 #ifndef SDL_FORCE_INLINE
 #if defined(_MSC_VER)
 #if defined(_MSC_VER)
@@ -139,6 +146,11 @@ typedef const WCHAR        *LPCWSTR;
 
 
 #endif
 #endif
 
 
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
 /* When porting SDLPAL to a new platform, please make a separate directory and put a file 
 /* 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.
    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.
    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. */
 # define PAL_HAS_OGG          1   /* Try always enable OGG. If compilation/run failed, please change this value to 0. */
 #endif
 #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
 #ifndef PAL_CONFIG_PREFIX
 # define PAL_CONFIG_PREFIX PAL_PREFIX
 # define PAL_CONFIG_PREFIX PAL_PREFIX
 #endif
 #endif
@@ -193,18 +197,14 @@ typedef const WCHAR        *LPCWSTR;
 # define PAL_SCALE_SCREEN   TRUE
 # define PAL_SCALE_SCREEN   TRUE
 #endif
 #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
 #ifndef PAL_IS_VALID_JOYSTICK
 # define PAL_IS_VALID_JOYSTICK(s)  TRUE
 # define PAL_IS_VALID_JOYSTICK(s)  TRUE
 #endif
 #endif
 
 
+#ifndef PAL_FATAL_OUTPUT
+# define PAL_FATAL_OUTPUT(s)
+#endif
+
 typedef enum tagCODEPAGE {
 typedef enum tagCODEPAGE {
 	CP_MIN = 0,
 	CP_MIN = 0,
 	CP_BIG5 = 0,
 	CP_BIG5 = 0,