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
24 //define a signed byte
25 typedef signed char sbyte;
27 //define unsigned types;
28 typedef unsigned char ubyte;
29 #if defined(_WIN32) || defined(macintosh)
30 typedef unsigned short ushort;
31 typedef unsigned int uint;
34 #if defined(_WIN32) || defined(__sun__) // platforms missing (u_)int??_t
35 # include <SDL_types.h>
36 #elif defined(macintosh) // misses (u_)int??_t and does not like SDL_types.h
37 # include <MacTypes.h>
38 typedef SInt16 int16_t;
39 typedef SInt32 int32_t;
40 typedef SInt64 int64_t;
41 typedef UInt16 u_int16_t;
42 typedef UInt32 u_int32_t;
43 typedef UInt64 u_int64_t;
45 #if defined(_WIN32) // platforms missing int??_t
46 typedef Sint16 int16_t;
47 typedef Sint32 int32_t;
48 typedef Sint64 int64_t;
49 #endif // defined(_WIN32)
50 #if defined(_WIN32) || defined(__sun__) // platforms missing u_int??_t
51 typedef Uint16 u_int16_t;
52 typedef Uint32 u_int32_t;
53 typedef Uint64 u_int64_t;
54 #endif // defined(_WIN32) || defined(__sun__)
57 # include <stdlib.h> // this is where min and max are defined
60 #define min(a,b) (((a)>(b))?(b):(a))
63 #define max(a,b) (((a)<(b))?(b):(a))
68 # define PATH_MAX _MAX_PATH
70 # define FNAME_MAX 256
71 #elif defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
72 # include <sys/types.h>
74 # define PATH_MAX 1024
76 # define FNAME_MAX 256
77 #elif defined __DJGPP__
78 # include <sys/types.h>
79 # define FNAME_MAX 9 // excluding extension
80 #elif defined(macintosh)
94 // the following stuff has nothing to do with types but needed everywhere,
95 // and since this file is included everywhere, it's here.
97 # define __pack__ __attribute__((packed))
98 #elif defined(_MSC_VER)
99 # pragma pack(push, packing)
102 #elif defined(macintosh)
103 # pragma options align=packed
106 # error d2x will not work without packed structures
110 # define inline __inline
113 #ifndef PACKAGE_STRING
114 # define PACKAGE_STRING "d2x"