]> icculus.org git repositories - btb/d2x.git/blob - include/pstypes.h
get rid of silly ulongs
[btb/d2x.git] / include / pstypes.h
1 /* $Id: pstypes.h,v 1.25 2003-12-08 22:32:56 btb Exp $ */
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 /*
16  *
17  * Common types for use in Miner
18  *
19  * Old Log:
20  * Revision 1.2  1993/09/14  12:12:30  matt
21  * Added #define for NULL
22  *
23  * Revision 1.1  1993/08/24  12:50:40  matt
24  * Initial revision
25  *
26  *
27  */
28
29 #ifndef _TYPES_H
30 #define _TYPES_H
31
32 // define a dboolean
33 typedef int dboolean;
34
35 //define a signed byte
36 typedef signed char sbyte;
37
38 //define unsigned types;
39 typedef unsigned char ubyte;
40 #ifndef __unix__
41 typedef unsigned short ushort;
42 typedef unsigned int uint;
43 #endif
44
45 #ifndef __unix__
46 #include <SDL_types.h>
47 typedef Sint16 int16_t;
48 typedef Sint32 int32_t;
49 typedef Sint64 int64_t;
50 typedef Uint16 u_int16_t;
51 typedef Uint32 u_int32_t;
52 typedef Uint64 u_int64_t;
53 #endif
54
55 #ifdef _MSC_VER
56 # include <stdlib.h> // this is where min and max are defined
57 #endif
58 #ifndef min
59 #define min(a,b) (((a)>(b))?(b):(a))
60 #endif
61 #ifndef max
62 #define max(a,b) (((a)<(b))?(b):(a))
63 #endif
64
65 #ifdef _WIN32
66 # ifndef __MINGW32__
67 #  define PATH_MAX _MAX_PATH
68 # endif
69 # ifdef _WIN32_WCE
70 #  define _MAX_DIR 256
71 # endif
72 #elif defined(__unix__)
73 # include <sys/types.h>
74 # define _MAX_PATH 1024
75 # define _MAX_DIR 256
76 #elif defined __DJGPP__
77 # include <sys/types.h>
78 # define _MAX_PATH 255
79 # define _MAX_DIR 63
80 #endif
81
82 #ifndef __cplusplus
83 //define a boolean
84 typedef ubyte bool;
85 #endif
86
87 #ifndef NULL
88 #define NULL 0
89 #endif
90
91 // the following stuff has nothing to do with types but needed everywhere,
92 // and since this file is included everywhere, it's here.
93 #ifdef __GNUC__
94 # define __pack__ __attribute__((packed))
95 #elif defined(_MSC_VER)
96 # pragma pack(push, packing)
97 # pragma pack(1)
98 # define __pack__
99 #else
100 # error d2x will not work without packed structures
101 #endif
102
103 #ifdef _MSC_VER
104 # define inline __inline
105 #endif
106
107 #ifndef PACKAGE_STRING
108 # define PACKAGE_STRING "d2x"
109 #endif
110
111 #endif //_TYPES_H
112