1 /* 2 * 3 * $Log: doomtype.h,v $ 4 * Revision 1.4 1998/10/16 06:33:04 chris 5 * moved FALSE and TRUE definition outside of '#ifndef HAVE_VALUES_H' 6 * block (was slipped in there by mistake) 7 * 8 * Revision 1.4 1999/01/13 20:47:xx Andre` Werthmann 9 * changed Heretic-source to work under Linux/GGI 10 * 11 * Revision 1.3 1998/10/14 23:17:42 chris 12 * introduced __32BIT__ and __64BIT__ defines 13 * 14 * Revision 1.2 1998/09/27 22:37:43 chris 15 * values.h isn't always present 16 * 17 * Revision 1.1 1998/09/27 22:18:42 chris 18 * Initial revision 19 * 20 * 21 * DESCRIPTION: 22 * Simple basic typedefs, isolated here to make it easier 23 * separating modules. 24 */ 25 26 27 #ifndef __DOOMTYPE__ 28 #define __DOOMTYPE__ 29 30 #ifndef __BYTEBOOL__ 31 #define __BYTEBOOL__ 32 typedef enum {false, true} boolean; 33 typedef boolean H_boolean; 34 typedef unsigned char byte; 35 #endif 36 37 /* Predefined with some OS. */ 38 #ifdef HAVE_VALUES_H 39 #include <values.h> 40 #ifndef MININT 41 #define MININT ((-(MAXINT)) - 1) 42 #endif 43 #else 44 45 #if defined(__alpha__) || defined(_LONGLONG) || defined(__64BIT__) 46 47 /* 64bit defines */ 48 49 #define MAXCHAR ((char)0x7f) 50 #define MAXSHORT ((short)0x7fff) 51 52 /* Max pos 32-bit int. */ 53 #define MAXINT ((int)0x7fffffff) 54 #define MAXLONG ((long)0x7fffffffffffffff) 55 #define MINCHAR ((char)0x80) 56 #define MINSHORT ((short)0x8000) 57 58 /* Max negative 32-bit integer. */ 59 #define MININT ((int)0x80000000) 60 #define MINLONG ((long)0x8000000000000000) 61 62 #elif defined(__32BIT__) 63 64 /* 32bit defines */ 65 66 #define MAXCHAR ((char)0x7f) 67 #define MAXSHORT ((short)0x7fff) 68 69 /* Max pos 32-bit int. */ 70 #define MAXINT ((int)0x7fffffff) 71 #define MAXLONG ((long)0x7fffffff) 72 #define MINCHAR ((char)0x80) 73 #define MINSHORT ((short)0x8000) 74 75 /* Max negative 32-bit integer. */ 76 #define MININT ((int)0x80000000) 77 #define MINLONG ((long)0x80000000) 78 79 #else /* previous: 32bit, next: error */ 80 81 /* safety guard */ 82 #ifndef __64BIT__ 83 #error not 32bit and not 64bit machine!? 84 #endif 85 86 #endif /* end of #if defined(__32BIT__) chunk */ 87 #endif /* #ifndef HAVE_VALUES_H */ 88 89 #ifndef FALSE 90 #define FALSE 0 91 #endif 92 #ifndef TRUE 93 #define TRUE 1 94 #endif 95 96 /* Structure packing */ 97 #ifndef __PACKED__ 98 #define __PACKED__ 99 #endif 100 101 #include <sys/types.h> 102 103 #endif /* __DOOMTYPE__ */ 104 105