]> icculus.org git repositories - btb/d2x.git/blob - include/pstypes.h
use Builtin_mission_num instead of 0 (if descent.hog is present, d1 becomes
[btb/d2x.git] / include / pstypes.h
1 /* $ Id: $ */
2 /*
3 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
4 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
5 END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
6 ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
7 IN USING, DISPLAYING,  AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
8 SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
9 FREE PURPOSES.  IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
10 CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES.  THE END-USER UNDERSTANDS
11 AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
12 COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
13 */
14
15 #ifndef _TYPES_H
16 #define _TYPES_H
17
18 // define a dboolean
19 typedef int dboolean;
20
21 //define a byte
22 typedef signed char byte;
23
24 //define unsigned types;
25 typedef unsigned char ubyte;
26 #ifndef __unix__
27 typedef unsigned short ushort;
28 typedef unsigned int uint;
29 typedef unsigned long ulong;
30 #endif
31
32 #ifndef min
33 #define min(a,b) (((a)>(b))?(b):(a))
34 #endif
35 #ifndef max
36 #define max(a,b) (((a)<(b))?(b):(a))
37 #endif
38
39 #if defined __MINGW32__
40 #include <stdint.h>
41 typedef uint64_t u_int64_t;
42 typedef uint32_t u_int32_t;
43 typedef uint16_t u_int16_t;
44
45 #elif defined __unix__
46 # include <sys/types.h>
47 # define _MAX_PATH 1024
48 # define _MAX_DIR 256
49 # ifdef __MACOSX__
50 typedef unsigned long ulong;
51 # endif
52 # ifdef __sun__
53 typedef uint64_t u_int64_t;
54 typedef uint32_t u_int32_t;
55 typedef uint16_t u_int16_t;
56 # endif
57
58 #elif defined __DJGPP__
59 # include <sys/types.h>
60 # define _MAX_PATH 255
61 # define _MAX_DIR 63
62 typedef signed int int32_t;
63 typedef unsigned int u_int32_t;
64 typedef signed short int16_t;
65 typedef unsigned short u_int16_t;
66
67 #endif
68
69 #ifndef __cplusplus
70 //define a boolean
71 typedef ubyte bool;
72 #endif
73
74 #ifndef NULL
75 #define NULL 0
76 #endif
77
78 // the following stuff has nothing to do with types but needed everywhere,
79 // and since this file is included everywhere, it's here.
80 #ifdef __GNUC__
81 # define __pack__ __attribute__((packed))
82 #else
83 # define __pack__
84 #endif
85
86 #endif //_TYPES_H
87