Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
threadsafe.h
Go to the documentation of this file.
1/*
2** Command & Conquer Generals Zero Hour(tm)
3** Copyright 2025 Electronic Arts Inc.
4**
5** This program is free software: you can redistribute it and/or modify
6** it under the terms of the GNU General Public License as published by
7** the Free Software Foundation, either version 3 of the License, or
8** (at your option) any later version.
9**
10** This program is distributed in the hope that it will be useful,
11** but WITHOUT ANY WARRANTY; without even the implied warranty of
12** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13** GNU General Public License for more details.
14**
15** You should have received a copy of the GNU General Public License
16** along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19//
20// threadsafe.h
21//
22// If you include this file and call non-threadsafe functions, it'll
23// prevent your program from compiling. It's meant to be a slap
24// on the wrist in case you forget and call an unsafe function
25// from a threadsafe program.
26//
27
28//
29// Reminder to self - use sigwait, not signal handlers!
30//
31
32#ifdef _REENTRANT
33
34#ifndef THREADSAFE_HEADER
35#define THREADSAFE_HEADER
36
37#define strtok ("strtok() is not MT-SAFE!")
38#define ascctime ("asctime() is not MT-SAFE!")
39// Can't just do ctime, as Windows' objidl.h uses it as a FILETIME thingie
40#define ctime(x) ("ctime() is not MT-SAFE!")
41#define gmtime ("gmtime() is not MT-SAFE!")
42#define localtime ("localtime() is not MT-SAFE!")
43#define tzset ("tzset() is not MT-SAFE!")
44#define tzsetwall ("tzsetwall() is not MT-SAFE!")
45#define readdir ("readdir() is not MT-SAFE!")
46
47#define rand ("rand() is not MT-SAFE!")
48#define srand ("srand() is not MT-SAFE!")
49#define random ("random() is not MT-SAFE!")
50#define srandom ("srandom() is not MT-SAFE!")
51
52#define tmpnam ("tmpnam() is not MT-SAFE!")
53#define vfork ("vfork() is not MT-SAFE!")
54
55#define system ("system() is not MT-SAFE!")
56#define popen ("popen() is not MT-SAFE!")
57#define pclose ("pclose() is not MT-SAFE!")
58#define ctermid ("ctermid() is not MT-SAFE!")
59#define getlogin ("getlogin() is not MT-SAFE!");
60
61#endif // THREADSAFE_HEADER
62#endif // _REENTRANT