wstypes.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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. * C O N F I D E N T I A L --- W E S T W O O D S T U D I O S *
  20. ******************************************************************************
  21. Project Name: Carpenter (The RedAlert ladder creator)
  22. File Name : wstypes.h
  23. Author : Neal Kettler
  24. Start Date : June 3, 1997
  25. Last Update : June 17, 1997
  26. Standard type definitions for the sake of portability and readability.
  27. \***************************************************************************/
  28. #ifndef WSTYPES_HEADER
  29. #define WSTYPES_HEADER
  30. #ifdef _REENTRANT // reentrant = threaded
  31. // Headers with non threadsafe libs need to come before my hacky
  32. // threadsafe.h otherwise they won't compile
  33. #include <time.h>
  34. #ifndef _WINDOWS
  35. #define _POSIX_C_SOURCE 199506L
  36. #define _POSIX_PTHREAD_SEMANTICS
  37. #define __EXTENSIONS__
  38. #endif
  39. #include <stdlib.h>
  40. #include <stdio.h>
  41. #include <string.h>
  42. #ifndef _WINDOWS
  43. #include <unistd.h>
  44. #include <sys/time.h>
  45. #include <dirent.h>
  46. #else
  47. #include <time.h>
  48. #include <sys/timeb.h>
  49. #endif
  50. #include "threadsafe.h" // enforce threadsafe-only calls
  51. #endif
  52. #define adelete(X) (delete[](X))
  53. #ifndef TRUE
  54. #define TRUE 1
  55. #endif
  56. #ifndef FALSE
  57. #define FALSE 0
  58. #endif
  59. #ifndef MIN
  60. #define MIN(x,y) (((x)<(y))?(x):(y))
  61. #endif
  62. #ifndef MAX
  63. #define MAX(x,y) (((x)>(y))?(x):(y))
  64. #endif
  65. #ifndef NULL
  66. #define NULL 0
  67. #endif
  68. //These are used for readability purposes mostly, when a method takes a
  69. // pointer or reference these help specify what will happen to the data
  70. // that is sent in.
  71. #ifdef IN
  72. #undef IN
  73. #endif
  74. #define IN const
  75. #define OUT
  76. #define INOUT
  77. #define _IN_ const
  78. // Used to declare a function or method as const or Read Only
  79. #define RO const
  80. typedef char bit8;
  81. typedef char sint8;
  82. typedef unsigned char uint8;
  83. typedef signed short int sint16;
  84. typedef unsigned short int uint16;
  85. typedef signed int sint32;
  86. typedef unsigned int uint32;
  87. typedef float float32;
  88. typedef double float64;
  89. #define MAX_BIT8 0x1
  90. #define MAX_UINT32 0xFFFFFFFF
  91. #define MAX_UINT16 0xFFFF
  92. #define MAX_UINT8 0xFF
  93. #define MAX_SINT32 0x7FFFFFFF
  94. #define MAX_SINT16 0x7FFF
  95. #define MAX_SINT8 0x7F
  96. #ifdef _WINDOWS
  97. #define strncasecmp _strnicmp
  98. #define strcasecmp _stricmp
  99. #endif
  100. #endif