aboutsummaryrefslogtreecommitdiff
path: root/common/forbidden.h
diff options
context:
space:
mode:
authorMax Horn2011-05-03 14:30:25 +0200
committerMax Horn2011-05-03 14:30:25 +0200
commit2fa63ca01586c4e5fda8eb12dca444d47a2375f1 (patch)
tree5edf495f2d7c5a7712c4a9a90c7e684d4837eec4 /common/forbidden.h
parenta50c36d1381be2e7d0748a2c734e41357fd4920f (diff)
downloadscummvm-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/forbidden.h')
-rw-r--r--common/forbidden.h132
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,