diff options
author | Thierry Crozat | 2016-09-04 02:26:08 +0100 |
---|---|---|
committer | Thierry Crozat | 2016-09-04 02:26:27 +0100 |
commit | 29535c0a55410684a263b493b1c75112f352bab6 (patch) | |
tree | 69c2973c1c24faae2ad7a3fd68424a72f373c6e8 /backends/platform/sdl | |
parent | 49cfa190df7825cb18b4985866b903ef9d01dcfd (diff) | |
download | scummvm-rg350-29535c0a55410684a263b493b1c75112f352bab6.tar.gz scummvm-rg350-29535c0a55410684a263b493b1c75112f352bab6.tar.bz2 scummvm-rg350-29535c0a55410684a263b493b1c75112f352bab6.zip |
SDL: Do not forbid time.h symbols when FORBIDDEN_SYMBOL_EXCEPTION_time_h is defined
This hopefully fixes a regression from 848c5c3.
Diffstat (limited to 'backends/platform/sdl')
-rw-r--r-- | backends/platform/sdl/sdl-sys.h | 189 |
1 files changed, 96 insertions, 93 deletions
diff --git a/backends/platform/sdl/sdl-sys.h b/backends/platform/sdl/sdl-sys.h index a00fcb7c6e..9ebd123bb4 100644 --- a/backends/platform/sdl/sdl-sys.h +++ b/backends/platform/sdl/sdl-sys.h @@ -69,50 +69,54 @@ typedef struct { int FAKE; } FAKE_FILE; // Fix compilation with MacPorts SDL 2 // It needs various (usually forbidden) symbols from time.h -#if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_asctime) -#undef asctime -#define asctime FAKE_asctime -#endif - -#if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_clock) -#undef clock -#define clock FAKE_clock -#endif - -#if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_ctime) -#undef ctime -#define ctime FAKE_ctime -#endif - -#if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_difftime) -#undef difftime -#define difftime FAKE_difftime -#endif - -#if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_getdate) -#undef getdate -#define getdate FAKE_getdate -#endif - -#if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_gmtime) -#undef gmtime -#define gmtime FAKE_gmtime -#endif - -#if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_localtime) -#undef localtime -#define localtime FAKE_localtime -#endif - -#if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_mktime) -#undef mktime -#define mktime FAKE_mktime -#endif - -#if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_time) -#undef time -#define time FAKE_time -#endif +#ifndef FORBIDDEN_SYMBOL_EXCEPTION_time_h + + #if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_asctime) + #undef asctime + #define asctime FAKE_asctime + #endif + + #if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_clock) + #undef clock + #define clock FAKE_clock + #endif + + #if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_ctime) + #undef ctime + #define ctime FAKE_ctime + #endif + + #if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_difftime) + #undef difftime + #define difftime FAKE_difftime + #endif + + #if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_getdate) + #undef getdate + #define getdate FAKE_getdate + #endif + + #if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_gmtime) + #undef gmtime + #define gmtime FAKE_gmtime + #endif + + #if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_localtime) + #undef localtime + #define localtime FAKE_localtime + #endif + + #if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_mktime) + #undef mktime + #define mktime FAKE_mktime + #endif + + #if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_time) + #undef time + #define time FAKE_time + #endif + +#endif // FORBIDDEN_SYMBOL_EXCEPTION_time_h // HACK: SDL might include windows.h which defines its own ARRAYSIZE. // However, we want to use the version from common/util.h. Thus, we make sure @@ -224,55 +228,54 @@ typedef struct { int FAKE; } FAKE_FILE; #endif // re-forbid all those time.h symbols again (if they were forbidden) -#if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_asctime) -#undef asctime -#define asctime(a) FORBIDDEN_SYMBOL_REPLACEMENT -#endif - -#if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_asctime) -#undef asctime -#define asctime(a) FORBIDDEN_SYMBOL_REPLACEMENT -#endif - -#if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_clock) -#undef clock -#define clock() FORBIDDEN_SYMBOL_REPLACEMENT -#endif - -#if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_ctime) -#undef ctime -#define ctime(a) FORBIDDEN_SYMBOL_REPLACEMENT -#endif - -#if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_difftime) -#undef difftime -#define difftime(a,b) FORBIDDEN_SYMBOL_REPLACEMENT -#endif - -#if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_getdate) -#undef getdate -#define getdate(a) FORBIDDEN_SYMBOL_REPLACEMENT -#endif - -#if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_gmtime) -#undef gmtime -#define gmtime(a) FORBIDDEN_SYMBOL_REPLACEMENT -#endif - -#if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_localtime) -#undef localtime -#define localtime(a) FORBIDDEN_SYMBOL_REPLACEMENT -#endif - -#if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_mktime) -#undef mktime -#define mktime(a) FORBIDDEN_SYMBOL_REPLACEMENT -#endif - -#if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_time) -#undef time -#define time(a) FORBIDDEN_SYMBOL_REPLACEMENT -#endif +#ifndef FORBIDDEN_SYMBOL_EXCEPTION_time_h + + #if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_asctime) + #undef asctime + #define asctime(a) FORBIDDEN_SYMBOL_REPLACEMENT + #endif + + #if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_clock) + #undef clock + #define clock() FORBIDDEN_SYMBOL_REPLACEMENT + #endif + + #if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_ctime) + #undef ctime + #define ctime(a) FORBIDDEN_SYMBOL_REPLACEMENT + #endif + + #if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_difftime) + #undef difftime + #define difftime(a,b) FORBIDDEN_SYMBOL_REPLACEMENT + #endif + + #if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_getdate) + #undef getdate + #define getdate(a) FORBIDDEN_SYMBOL_REPLACEMENT + #endif + + #if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_gmtime) + #undef gmtime + #define gmtime(a) FORBIDDEN_SYMBOL_REPLACEMENT + #endif + + #if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_localtime) + #undef localtime + #define localtime(a) FORBIDDEN_SYMBOL_REPLACEMENT + #endif + + #if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_mktime) + #undef mktime + #define mktime(a) FORBIDDEN_SYMBOL_REPLACEMENT + #endif + + #if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_time) + #undef time + #define time(a) FORBIDDEN_SYMBOL_REPLACEMENT + #endif + +#endif // FORBIDDEN_SYMBOL_EXCEPTION_time_h // SDL 2 has major API changes. We redefine constants which got renamed to // ease the transition. This is sometimes dangerous because the values changed |