ScummVM
|
This header file is meant to help ensure that engines and infrastructure code do not make use of certain "forbidden" APIs, such as fopen(), setjmp(), etc. More...
#include "common/scummsys.h"
Go to the source code of this file.
This header file is meant to help ensure that engines and infrastructure code do not make use of certain "forbidden" APIs, such as fopen(), setjmp(), etc.
This is achieved by re-#defining various symbols to a "garbage" string which then triggers a compiler error.
Backend files may #define FORBIDDEN_SYMBOL_ALLOW_ALL if they have to access functions like fopen, fread etc. Regular code, esp. code in engines/, should never do that. To ease transition, though, we allow re-enabling selected symbols in frontend code. However, this should only be used as a temporary measure. Especially new code should avoid this at all costs.
Definition in file forbidden.h.
#define abort | ( | ) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 210 of file forbidden.h.
#define asctime | ( | a | ) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 248 of file forbidden.h.
#define chdir | ( | a | ) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 300 of file forbidden.h.
#define clock | ( | ) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 253 of file forbidden.h.
#define ctime | ( | a | ) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 258 of file forbidden.h.
#define difftime | ( | a, | |
b | |||
) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 263 of file forbidden.h.
#define exit | ( | a | ) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 205 of file forbidden.h.
#define fclose | ( | a | ) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 107 of file forbidden.h.
#define feof | ( | a | ) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 132 of file forbidden.h.
#define fgetc | ( | a | ) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 137 of file forbidden.h.
#define fgets | ( | a, | |
b, | |||
c | |||
) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 147 of file forbidden.h.
#define FILE FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 82 of file forbidden.h.
#define fopen | ( | a, | |
b | |||
) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 102 of file forbidden.h.
#define FORBIDDEN_SYMBOL_REPLACEMENT FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%* |
The garbage string to use as replacement for forbidden symbols.
The reason for this particular string is the following: By including a space and some non-alphanumeric symbols we trigger a compiler error. By including the words "forbidden symbol" (which the compiler will hopefully print along with its own error message), we try to make clear what is causing the error.
Definition at line 57 of file forbidden.h.
#define fprintf FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 67 of file forbidden.h.
#define fputc | ( | a, | |
b | |||
) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 142 of file forbidden.h.
#define fputs | ( | a, | |
b | |||
) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 152 of file forbidden.h.
#define fread | ( | a, | |
b, | |||
c, | |||
d | |||
) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 112 of file forbidden.h.
#define fseek | ( | a, | |
b, | |||
c | |||
) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 122 of file forbidden.h.
#define ftell | ( | a | ) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 127 of file forbidden.h.
#define fwrite | ( | a, | |
b, | |||
c, | |||
d | |||
) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 117 of file forbidden.h.
#define getc | ( | a | ) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 157 of file forbidden.h.
#define getchar | ( | ) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 177 of file forbidden.h.
#define getcwd | ( | a, | |
b | |||
) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 305 of file forbidden.h.
#define getdate | ( | a | ) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 268 of file forbidden.h.
#define getenv | ( | a | ) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 215 of file forbidden.h.
#define gets | ( | a | ) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 167 of file forbidden.h.
#define getwd | ( | a | ) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 310 of file forbidden.h.
#define gmtime | ( | a | ) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 273 of file forbidden.h.
#define isalnum | ( | a | ) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 328 of file forbidden.h.
#define isalpha | ( | a | ) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 333 of file forbidden.h.
#define iscntrl | ( | a | ) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 338 of file forbidden.h.
#define isdigit | ( | a | ) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 343 of file forbidden.h.
#define isgraph | ( | a | ) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 348 of file forbidden.h.
#define islower | ( | a | ) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 358 of file forbidden.h.
#define isnumber | ( | a | ) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 353 of file forbidden.h.
#define isprint | ( | a | ) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 363 of file forbidden.h.
#define ispunct | ( | a | ) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 368 of file forbidden.h.
#define isspace | ( | a | ) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 373 of file forbidden.h.
#define isupper | ( | a | ) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 378 of file forbidden.h.
#define isxdigit | ( | a | ) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 383 of file forbidden.h.
#define localtime | ( | a | ) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 278 of file forbidden.h.
#define longjmp | ( | a, | |
b | |||
) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 194 of file forbidden.h.
#define mkdir | ( | a, | |
b | |||
) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 390 of file forbidden.h.
#define mktime | ( | a | ) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 283 of file forbidden.h.
#define printf FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 62 of file forbidden.h.
#define putc | ( | a, | |
b | |||
) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 162 of file forbidden.h.
#define putchar | ( | a | ) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 182 of file forbidden.h.
#define putenv | ( | a | ) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 220 of file forbidden.h.
#define puts | ( | a | ) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 172 of file forbidden.h.
#define rand | ( | ) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 423 of file forbidden.h.
#define random | ( | ) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 433 of file forbidden.h.
#define setenv | ( | a, | |
b, | |||
c | |||
) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 225 of file forbidden.h.
#define setjmp | ( | a | ) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 189 of file forbidden.h.
#define setvbuf | ( | a, | |
b, | |||
c, | |||
d | |||
) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 402 of file forbidden.h.
#define srand | ( | a | ) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 428 of file forbidden.h.
#define srandom | ( | a | ) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 438 of file forbidden.h.
#define stderr FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 97 of file forbidden.h.
#define stdin FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 87 of file forbidden.h.
#define stdout FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 92 of file forbidden.h.
#define strcasecmp | ( | a, | |
b | |||
) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 454 of file forbidden.h.
#define strdup | ( | a | ) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 464 of file forbidden.h.
#define stricmp | ( | a, | |
b | |||
) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 444 of file forbidden.h.
#define strncasecmp | ( | a, | |
b, | |||
c | |||
) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 459 of file forbidden.h.
#define strnicmp | ( | a, | |
b, | |||
c | |||
) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 449 of file forbidden.h.
#define system | ( | a | ) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 200 of file forbidden.h.
#define tempnam | ( | a, | |
b | |||
) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 418 of file forbidden.h.
#define time | ( | a | ) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 288 of file forbidden.h.
#define tmpfile | ( | ) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 408 of file forbidden.h.
#define tmpnam | ( | a | ) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 413 of file forbidden.h.
#define unlink | ( | a | ) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 315 of file forbidden.h.
#define unsetenv | ( | a | ) | FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 230 of file forbidden.h.
#define vfprintf FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 77 of file forbidden.h.
#define vprintf FORBIDDEN_SYMBOL_REPLACEMENT |
Definition at line 72 of file forbidden.h.