1 /* $Id: pstypes.h,v 1.31 2004-08-03 20:27:32 schaffner Exp $ */
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.
17 * Common types for use in Miner
20 * Revision 1.2 1993/09/14 12:12:30 matt
21 * Added #define for NULL
23 * Revision 1.1 1993/08/24 12:50:40 matt
35 //define a signed byte
36 typedef signed char sbyte;
38 //define unsigned types;
39 typedef unsigned char ubyte;
40 #if defined(_WIN32) || defined(macintosh)
41 typedef unsigned short ushort;
42 typedef unsigned int uint;
45 #if defined(_WIN32) || defined(__sun__) // platforms missing (u_)int??_t
46 # include <SDL_types.h>
47 #elif defined(macintosh) // misses (u_)int??_t and does not like SDL_types.h
48 # include <MacTypes.h>
49 typedef SInt16 int16_t;
50 typedef SInt32 int32_t;
51 typedef SInt64 int64_t;
52 typedef UInt16 u_int16_t;
53 typedef UInt32 u_int32_t;
54 typedef UInt64 u_int64_t;
56 #if defined(_WIN32) // platforms missing int??_t
57 typedef Sint16 int16_t;
58 typedef Sint32 int32_t;
59 typedef Sint64 int64_t;
60 #endif // defined(_WIN32)
61 #if defined(_WIN32) || defined(__sun__) // platforms missing u_int??_t
62 typedef Uint16 u_int16_t;
63 typedef Uint32 u_int32_t;
64 typedef Uint64 u_int64_t;
65 #endif // defined(_WIN32) || defined(__sun__)
68 # include <stdlib.h> // this is where min and max are defined
71 #define min(a,b) (((a)>(b))?(b):(a))
74 #define max(a,b) (((a)<(b))?(b):(a))
79 # define PATH_MAX _MAX_PATH
84 #elif defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
85 # include <sys/types.h>
86 # define _MAX_PATH 1024
88 #elif defined __DJGPP__
89 # include <sys/types.h>
90 # define _MAX_PATH 255
92 #elif defined(macintosh)
93 # define _MAX_PATH 255
95 # define PATH_MAX _MAX_PATH
107 // the following stuff has nothing to do with types but needed everywhere,
108 // and since this file is included everywhere, it's here.
110 # define __pack__ __attribute__((packed))
111 #elif defined(_MSC_VER)
112 # pragma pack(push, packing)
115 #elif defined(macintosh)
116 # pragma options align=packed
119 # error d2x will not work without packed structures
123 # define inline __inline
126 #ifndef PACKAGE_STRING
127 # define PACKAGE_STRING "d2x"