1 /* $Id: pstypes.h,v 1.33 2005-01-25 21:20:29 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
27 //define a signed byte
28 typedef signed char sbyte;
30 //define unsigned types;
31 typedef unsigned char ubyte;
32 #if defined(_WIN32) || defined(macintosh)
33 typedef unsigned short ushort;
34 typedef unsigned int uint;
37 #if defined(_WIN32) || defined(__sun__) // platforms missing (u_)int??_t
38 # include <SDL_types.h>
39 #elif defined(macintosh) // misses (u_)int??_t and does not like SDL_types.h
40 # include <MacTypes.h>
41 typedef SInt16 int16_t;
42 typedef SInt32 int32_t;
43 typedef SInt64 int64_t;
44 typedef UInt16 u_int16_t;
45 typedef UInt32 u_int32_t;
46 typedef UInt64 u_int64_t;
48 #if defined(_WIN32) // platforms missing int??_t
49 typedef Sint16 int16_t;
50 typedef Sint32 int32_t;
51 typedef Sint64 int64_t;
52 #endif // defined(_WIN32)
53 #if defined(_WIN32) || defined(__sun__) // platforms missing u_int??_t
54 typedef Uint16 u_int16_t;
55 typedef Uint32 u_int32_t;
56 typedef Uint64 u_int64_t;
57 #endif // defined(_WIN32) || defined(__sun__)
60 # include <stdlib.h> // this is where min and max are defined
63 #define min(a,b) (((a)>(b))?(b):(a))
66 #define max(a,b) (((a)<(b))?(b):(a))
71 # define PATH_MAX _MAX_PATH
73 # define FNAME_MAX 256
74 #elif defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
75 # include <sys/types.h>
77 # define PATH_MAX 1024
79 # define FNAME_MAX 256
80 #elif defined __DJGPP__
81 # include <sys/types.h>
82 # define FNAME_MAX 9 // excluding extension
83 #elif defined(macintosh)
97 // the following stuff has nothing to do with types but needed everywhere,
98 // and since this file is included everywhere, it's here.
100 # define __pack__ __attribute__((packed))
101 #elif defined(_MSC_VER)
102 # pragma pack(push, packing)
105 #elif defined(macintosh)
106 # pragma options align=packed
109 # error d2x will not work without packed structures
113 # define inline __inline
116 #ifndef PACKAGE_STRING
117 # define PACKAGE_STRING "d2x"