Franklin Wei | a855d62 | 2017-01-21 15:18:31 -0500 | [diff] [blame] | 1 | //------------------------------------------------------------------------- |
| 2 | /* |
| 3 | Copyright (C) 1996, 2003 - 3D Realms Entertainment |
| 4 | |
| 5 | This file is part of Duke Nukem 3D version 1.5 - Atomic Edition |
| 6 | |
| 7 | Duke Nukem 3D is free software; you can redistribute it and/or |
| 8 | modify it under the terms of the GNU General Public License |
| 9 | as published by the Free Software Foundation; either version 2 |
| 10 | of the License, or (at your option) any later version. |
| 11 | |
| 12 | This program is distributed in the hope that it will be useful, |
| 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 15 | |
| 16 | See the GNU General Public License for more details. |
| 17 | |
| 18 | You should have received a copy of the GNU General Public License |
| 19 | aint32_t with this program; if not, write to the Free Software |
| 20 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 21 | |
| 22 | Original Source: 1996 - Todd Replogle |
| 23 | Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms |
| 24 | */ |
| 25 | //------------------------------------------------------------------------- |
| 26 | |
| 27 | #ifndef _types_public |
| 28 | #define _types_public |
| 29 | |
Vencislav Atanasov | 183e45e | 2019-07-28 23:31:50 +0300 | [diff] [blame^] | 30 | #include <inttypes.h> |
Franklin Wei | a855d62 | 2017-01-21 15:18:31 -0500 | [diff] [blame] | 31 | |
| 32 | #ifdef __cplusplus |
| 33 | extern "C" { |
| 34 | #endif |
| 35 | |
| 36 | |
| 37 | //*************************************************************************** |
| 38 | // |
| 39 | // Global Data Types (For portability) |
| 40 | // |
| 41 | //*************************************************************************** |
| 42 | |
| 43 | typedef uint8_t uint8; |
| 44 | typedef uint8 byte; |
| 45 | typedef int8_t int8; |
| 46 | |
| 47 | typedef uint16_t uint16; |
| 48 | typedef uint16_t word; |
| 49 | typedef int16_t int16; |
| 50 | |
| 51 | typedef uint32_t uint32; |
| 52 | typedef int32_t int32; |
| 53 | typedef uint32 dword; |
| 54 | |
| 55 | typedef int32 fixed; |
| 56 | #define boolean uint8_t |
| 57 | typedef float float32; |
| 58 | typedef double float64; |
| 59 | typedef int64_t float128; |
| 60 | typedef float64 appfloat; |
| 61 | |
| 62 | |
| 63 | |
| 64 | //*************************************************************************** |
| 65 | // |
| 66 | // boolean values |
| 67 | // |
| 68 | //*************************************************************************** |
| 69 | |
| 70 | #define true ( 1 == 1 ) |
| 71 | #define false ( ! true ) |
| 72 | |
| 73 | //*************************************************************************** |
| 74 | // |
| 75 | // BYTE ACCESS MACROS |
| 76 | // |
| 77 | //*************************************************************************** |
| 78 | |
| 79 | // WORD macros |
| 80 | #define Int16_HighByte( x ) ( (uint8) ((x)>>8) ) |
| 81 | #define Int16_LowByte( x ) ( (uint8) ((x)&0xff) ) |
| 82 | |
| 83 | // DWORD macros |
| 84 | #define Int32_4Byte( x ) ( (uint8) ((x)>>24)&0xff ) |
| 85 | #define Int32_3Byte( x ) ( (uint8) (((x)>>16)&0xff) ) |
| 86 | #define Int32_2Byte( x ) ( (uint8) (((x)>>8)&0xff) ) |
| 87 | #define Int32_1Byte( x ) ( (uint8) ((x)&0xff) ) |
| 88 | |
| 89 | #ifdef __NeXT__ |
| 90 | #define stricmp strcasecmp |
| 91 | #define strcmpi strcasecmp |
| 92 | #endif |
| 93 | |
| 94 | #ifdef __cplusplus |
| 95 | }; |
| 96 | #endif |
| 97 | #endif |