summaryrefslogtreecommitdiff
path: root/src/game/bg_lib.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/bg_lib.h')
-rw-r--r--src/game/bg_lib.h27
1 files changed, 17 insertions, 10 deletions
diff --git a/src/game/bg_lib.h b/src/game/bg_lib.h
index 6225ce99..b872709a 100644
--- a/src/game/bg_lib.h
+++ b/src/game/bg_lib.h
@@ -40,21 +40,28 @@ typedef char * va_list;
#define va_arg(ap,t) ( *(t *)((ap += _INTSIZEOF(t)) - _INTSIZEOF(t)) )
#define va_end(ap) ( ap = (va_list)0 )
-#define CHAR_BIT 8 /* number of bits in a char */
-#define SCHAR_MIN (-128) /* minimum signed char value */
-#define SCHAR_MAX 127 /* maximum signed char value */
-#define UCHAR_MAX 0xff /* maximum unsigned char value */
+#define CHAR_BIT 8 /* number of bits in a char */
+#define SCHAR_MAX 0x7f /* maximum signed char value */
+#define SCHAR_MIN (-SCHAR_MAX - 1)/* minimum signed char value */
+#define UCHAR_MAX 0xff /* maximum unsigned char value */
-#define SHRT_MIN (-32768) /* minimum (signed) short value */
-#define SHRT_MAX 32767 /* maximum (signed) short value */
+#define SHRT_MAX 0x7fff /* maximum (signed) short value */
+#define SHRT_MIN (-SHRT_MAX - 1) /* minimum (signed) short value */
#define USHRT_MAX 0xffff /* maximum unsigned short value */
-#define INT_MIN (-2147483647 - 1) /* minimum (signed) int value */
-#define INT_MAX 2147483647 /* maximum (signed) int value */
+#define INT_MAX 0x7fffffff /* maximum (signed) int value */
+#define INT_MIN (-INT_MAX - 1) /* minimum (signed) int value */
#define UINT_MAX 0xffffffff /* maximum unsigned int value */
-#define LONG_MIN (-2147483647L - 1) /* minimum (signed) long value */
-#define LONG_MAX 2147483647L /* maximum (signed) long value */
+#define LONG_MAX 0x7fffffffL /* maximum (signed) long value */
+#define LONG_MIN (-LONG_MAX - 1) /* minimum (signed) long value */
#define ULONG_MAX 0xffffffffUL /* maximum unsigned long value */
+typedef signed char int8_t;
+typedef unsigned char uint8_t;
+typedef signed short int16_t;
+typedef unsigned short uint16_t;
+typedef signed long int32_t;
+typedef unsigned long uint32_t;
+
#define isalnum(c) (isalpha(c) || isdigit(c))
#define isalpha(c) (isupper(c) || islower(c))
#define isascii(c) ((c) > 0 && (c) <= 0x7f)