diff options
author | Max Horn | 2011-05-03 14:30:25 +0200 |
---|---|---|
committer | Max Horn | 2011-05-03 14:30:25 +0200 |
commit | 2fa63ca01586c4e5fda8eb12dca444d47a2375f1 (patch) | |
tree | 5edf495f2d7c5a7712c4a9a90c7e684d4837eec4 /common | |
parent | a50c36d1381be2e7d0748a2c734e41357fd4920f (diff) | |
download | scummvm-rg350-2fa63ca01586c4e5fda8eb12dca444d47a2375f1.tar.gz scummvm-rg350-2fa63ca01586c4e5fda8eb12dca444d47a2375f1.tar.bz2 scummvm-rg350-2fa63ca01586c4e5fda8eb12dca444d47a2375f1.zip |
COMMON: Forbid use of getcwd&getwd; add macro to enable unistd.h compatibility
Diffstat (limited to 'common')
-rw-r--r-- | common/forbidden.h | 132 |
1 files changed, 75 insertions, 57 deletions
diff --git a/common/forbidden.h b/common/forbidden.h index c22c646b79..af22b2ee21 100644 --- a/common/forbidden.h +++ b/common/forbidden.h @@ -144,68 +144,91 @@ #endif +// // Disable various symbols from time.h +// #ifndef FORBIDDEN_SYMBOL_EXCEPTION_time_h -/* -#ifndef FORBIDDEN_SYMBOL_EXCEPTION_time_t -#undef time_t -#define time_t FORBIDDEN_SYMBOL_REPLACEMENT -#endif -*/ - -#ifndef FORBIDDEN_SYMBOL_EXCEPTION_asctime -#undef asctime -#define asctime(a) FORBIDDEN_SYMBOL_REPLACEMENT -#endif - -#ifndef FORBIDDEN_SYMBOL_EXCEPTION_clock -#undef clock -#define clock() FORBIDDEN_SYMBOL_REPLACEMENT -#endif - -#ifndef FORBIDDEN_SYMBOL_EXCEPTION_ctime -#undef ctime -#define ctime(a) FORBIDDEN_SYMBOL_REPLACEMENT -#endif - -#ifndef FORBIDDEN_SYMBOL_EXCEPTION_difftime -#undef difftime -#define difftime(a,b) FORBIDDEN_SYMBOL_REPLACEMENT -#endif + /* + #ifndef FORBIDDEN_SYMBOL_EXCEPTION_time_t + #undef time_t + #define time_t FORBIDDEN_SYMBOL_REPLACEMENT + #endif + */ + + #ifndef FORBIDDEN_SYMBOL_EXCEPTION_asctime + #undef asctime + #define asctime(a) FORBIDDEN_SYMBOL_REPLACEMENT + #endif + + #ifndef FORBIDDEN_SYMBOL_EXCEPTION_clock + #undef clock + #define clock() FORBIDDEN_SYMBOL_REPLACEMENT + #endif + + #ifndef FORBIDDEN_SYMBOL_EXCEPTION_ctime + #undef ctime + #define ctime(a) FORBIDDEN_SYMBOL_REPLACEMENT + #endif + + #ifndef FORBIDDEN_SYMBOL_EXCEPTION_difftime + #undef difftime + #define difftime(a,b) FORBIDDEN_SYMBOL_REPLACEMENT + #endif + + #ifndef FORBIDDEN_SYMBOL_EXCEPTION_getdate + #undef getdate + #define getdate(a) FORBIDDEN_SYMBOL_REPLACEMENT + #endif + + #ifndef FORBIDDEN_SYMBOL_EXCEPTION_gmtime + #undef gmtime + #define gmtime(a) FORBIDDEN_SYMBOL_REPLACEMENT + #endif + + #ifndef FORBIDDEN_SYMBOL_EXCEPTION_localtime + #undef localtime + #define localtime(a) FORBIDDEN_SYMBOL_REPLACEMENT + #endif + + #ifndef FORBIDDEN_SYMBOL_EXCEPTION_mktime + #undef mktime + #define mktime(a) FORBIDDEN_SYMBOL_REPLACEMENT + #endif + + #ifndef FORBIDDEN_SYMBOL_EXCEPTION_time + #undef time + #define time(a) FORBIDDEN_SYMBOL_REPLACEMENT + #endif -#ifndef FORBIDDEN_SYMBOL_EXCEPTION_getdate -#undef getdate -#define getdate(a) FORBIDDEN_SYMBOL_REPLACEMENT -#endif +#endif // FORBIDDEN_SYMBOL_EXCEPTION_time_h -#ifndef FORBIDDEN_SYMBOL_EXCEPTION_gmtime -#undef gmtime -#define gmtime(a) FORBIDDEN_SYMBOL_REPLACEMENT -#endif +// +// Disable various symbols from unistd.h +// +#ifndef FORBIDDEN_SYMBOL_EXCEPTION_unistd_h -#ifndef FORBIDDEN_SYMBOL_EXCEPTION_localtime -#undef localtime -#define localtime(a) FORBIDDEN_SYMBOL_REPLACEMENT -#endif + #ifndef FORBIDDEN_SYMBOL_EXCEPTION_chdir + #undef chdir + #define chdir(a) FORBIDDEN_SYMBOL_REPLACEMENT + #endif -#ifndef FORBIDDEN_SYMBOL_EXCEPTION_mktime -#undef mktime -#define mktime(a) FORBIDDEN_SYMBOL_REPLACEMENT -#endif + #ifndef FORBIDDEN_SYMBOL_EXCEPTION_getcwd + #undef getcwd + #define getcwd(a,b) FORBIDDEN_SYMBOL_REPLACEMENT + #endif -#ifndef FORBIDDEN_SYMBOL_EXCEPTION_time -#undef time -#define time(a) FORBIDDEN_SYMBOL_REPLACEMENT -#endif - -#endif // FORBIDDEN_SYMBOL_EXCEPTION_time_h + #ifndef FORBIDDEN_SYMBOL_EXCEPTION_getwd + #undef getwd + #define getwd(a) FORBIDDEN_SYMBOL_REPLACEMENT + #endif + #ifndef FORBIDDEN_SYMBOL_EXCEPTION_unlink + #undef unlink + #define unlink(a) FORBIDDEN_SYMBOL_REPLACEMENT + #endif -#ifndef FORBIDDEN_SYMBOL_EXCEPTION_chdir -#undef chdir -#define chdir(a) FORBIDDEN_SYMBOL_REPLACEMENT -#endif +#endif // FORBIDDEN_SYMBOL_EXCEPTION_unistd_h #ifndef FORBIDDEN_SYMBOL_EXCEPTION_mkdir #undef mkdir @@ -224,11 +247,6 @@ #define setvbuf(a,b,c,d) FORBIDDEN_SYMBOL_REPLACEMENT #endif -#ifndef FORBIDDEN_SYMBOL_EXCEPTION_unlink -#undef unlink -#define unlink(a) FORBIDDEN_SYMBOL_REPLACEMENT -#endif - /* * We also would like to disable the following symbols; * however, these are also frequently used in regular code, |