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