threadsafe.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. ** Command & Conquer Renegade(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. // threadsafe.h
  20. //
  21. // If you include this file and call non-threadsafe functions, it'll
  22. // prevent your program from compiling. It's meant to be a slap
  23. // on the wrist in case you forget and call an unsafe function
  24. // from a threadsafe program.
  25. //
  26. //
  27. // Reminder to self - use sigwait, not signal handlers!
  28. //
  29. #ifdef _REENTRANT
  30. #ifndef THREADSAFE_HEADER
  31. #define THREADSAFE_HEADER
  32. #define strtok ("strtok() is not MT-SAFE!")
  33. #define ascctime ("asctime() is not MT-SAFE!")
  34. // Can't just do ctime, as Windows' objidl.h uses it as a FILETIME thingie
  35. #define ctime(x) ("ctime() is not MT-SAFE!")
  36. #define gmtime ("gmtime() is not MT-SAFE!")
  37. #define localtime ("localtime() is not MT-SAFE!")
  38. #define tzset ("tzset() is not MT-SAFE!")
  39. #define tzsetwall ("tzsetwall() is not MT-SAFE!")
  40. #define readdir ("readdir() is not MT-SAFE!")
  41. #define rand ("rand() is not MT-SAFE!")
  42. #define srand ("srand() is not MT-SAFE!")
  43. #define random ("random() is not MT-SAFE!")
  44. #define srandom ("srandom() is not MT-SAFE!")
  45. #define tmpnam ("tmpnam() is not MT-SAFE!")
  46. #define vfork ("vfork() is not MT-SAFE!")
  47. #define system ("system() is not MT-SAFE!")
  48. #define popen ("popen() is not MT-SAFE!")
  49. #define pclose ("pclose() is not MT-SAFE!")
  50. #define ctermid ("ctermid() is not MT-SAFE!")
  51. #define getlogin ("getlogin() is not MT-SAFE!");
  52. #endif // THREADSAFE_HEADER
  53. #endif // _REENTRANT