2005-01-25 21:20:29 +00:00
|
|
|
/* $Id: pstypes.h,v 1.33 2005-01-25 21:20:29 schaffner Exp $ */
|
2001-01-19 03:30:16 +00:00
|
|
|
/*
|
|
|
|
THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
|
|
|
|
SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
|
|
|
|
END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
|
|
|
|
ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
|
|
|
|
IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
|
|
|
|
SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
|
|
|
|
FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
|
|
|
|
CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
|
2002-08-02 04:57:19 +00:00
|
|
|
AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
|
2001-01-19 03:30:16 +00:00
|
|
|
COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
|
|
|
|
*/
|
|
|
|
|
2003-10-04 03:14:48 +00:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
* Common types for use in Miner
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2001-01-19 03:30:16 +00:00
|
|
|
#ifndef _TYPES_H
|
|
|
|
#define _TYPES_H
|
|
|
|
|
|
|
|
// define a dboolean
|
|
|
|
typedef int dboolean;
|
|
|
|
|
2003-10-04 03:14:48 +00:00
|
|
|
//define a signed byte
|
|
|
|
typedef signed char sbyte;
|
2001-01-19 03:30:16 +00:00
|
|
|
|
|
|
|
//define unsigned types;
|
|
|
|
typedef unsigned char ubyte;
|
2004-08-01 13:01:39 +00:00
|
|
|
#if defined(_WIN32) || defined(macintosh)
|
2001-10-12 00:18:40 +00:00
|
|
|
typedef unsigned short ushort;
|
|
|
|
typedef unsigned int uint;
|
2003-11-26 12:26:36 +00:00
|
|
|
#endif
|
|
|
|
|
2004-08-03 20:27:32 +00:00
|
|
|
#if defined(_WIN32) || defined(__sun__) // platforms missing (u_)int??_t
|
2004-08-01 13:01:39 +00:00
|
|
|
# include <SDL_types.h>
|
2004-08-03 20:27:32 +00:00
|
|
|
#elif defined(macintosh) // misses (u_)int??_t and does not like SDL_types.h
|
2004-08-01 13:01:39 +00:00
|
|
|
# include <MacTypes.h>
|
2004-08-03 20:27:32 +00:00
|
|
|
typedef SInt16 int16_t;
|
|
|
|
typedef SInt32 int32_t;
|
|
|
|
typedef SInt64 int64_t;
|
|
|
|
typedef UInt16 u_int16_t;
|
|
|
|
typedef UInt32 u_int32_t;
|
|
|
|
typedef UInt64 u_int64_t;
|
|
|
|
#endif // macintosh
|
|
|
|
#if defined(_WIN32) // platforms missing int??_t
|
2004-08-01 13:01:39 +00:00
|
|
|
typedef Sint16 int16_t;
|
|
|
|
typedef Sint32 int32_t;
|
|
|
|
typedef Sint64 int64_t;
|
2004-08-03 20:27:32 +00:00
|
|
|
#endif // defined(_WIN32)
|
|
|
|
#if defined(_WIN32) || defined(__sun__) // platforms missing u_int??_t
|
2004-08-01 13:01:39 +00:00
|
|
|
typedef Uint16 u_int16_t;
|
|
|
|
typedef Uint32 u_int32_t;
|
|
|
|
typedef Uint64 u_int64_t;
|
2004-08-03 20:27:32 +00:00
|
|
|
#endif // defined(_WIN32) || defined(__sun__)
|
2001-10-12 00:18:40 +00:00
|
|
|
|
2003-11-26 12:26:36 +00:00
|
|
|
#ifdef _MSC_VER
|
|
|
|
# include <stdlib.h> // this is where min and max are defined
|
|
|
|
#endif
|
2001-10-19 00:00:36 +00:00
|
|
|
#ifndef min
|
|
|
|
#define min(a,b) (((a)>(b))?(b):(a))
|
|
|
|
#endif
|
|
|
|
#ifndef max
|
|
|
|
#define max(a,b) (((a)<(b))?(b):(a))
|
|
|
|
#endif
|
2001-10-12 00:18:40 +00:00
|
|
|
|
2003-11-27 00:21:04 +00:00
|
|
|
#ifdef _WIN32
|
|
|
|
# ifndef __MINGW32__
|
|
|
|
# define PATH_MAX _MAX_PATH
|
|
|
|
# endif
|
2005-01-25 21:20:29 +00:00
|
|
|
# define FNAME_MAX 256
|
2004-05-31 08:33:41 +00:00
|
|
|
#elif defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
|
2001-01-19 03:30:16 +00:00
|
|
|
# include <sys/types.h>
|
2005-01-25 21:20:29 +00:00
|
|
|
# ifndef PATH_MAX
|
|
|
|
# define PATH_MAX 1024
|
|
|
|
# endif
|
|
|
|
# define FNAME_MAX 256
|
2001-10-12 10:03:32 +00:00
|
|
|
#elif defined __DJGPP__
|
2001-01-19 03:34:09 +00:00
|
|
|
# include <sys/types.h>
|
2005-01-25 21:20:29 +00:00
|
|
|
# define FNAME_MAX 9 // excluding extension
|
2004-08-01 13:01:39 +00:00
|
|
|
#elif defined(macintosh)
|
2005-01-25 21:20:29 +00:00
|
|
|
# define PATH_MAX 256
|
|
|
|
# define FNAME_MAX 32
|
2001-01-19 03:30:16 +00:00
|
|
|
#endif
|
|
|
|
|
2002-02-11 07:44:04 +00:00
|
|
|
#ifndef __cplusplus
|
2001-01-19 03:30:16 +00:00
|
|
|
//define a boolean
|
|
|
|
typedef ubyte bool;
|
2002-02-11 07:44:04 +00:00
|
|
|
#endif
|
2001-01-19 03:30:16 +00:00
|
|
|
|
|
|
|
#ifndef NULL
|
|
|
|
#define NULL 0
|
|
|
|
#endif
|
|
|
|
|
2003-01-02 23:13:21 +00:00
|
|
|
// the following stuff has nothing to do with types but needed everywhere,
|
|
|
|
// and since this file is included everywhere, it's here.
|
2002-08-31 03:17:40 +00:00
|
|
|
#ifdef __GNUC__
|
|
|
|
# define __pack__ __attribute__((packed))
|
2003-11-26 12:26:36 +00:00
|
|
|
#elif defined(_MSC_VER)
|
|
|
|
# pragma pack(push, packing)
|
|
|
|
# pragma pack(1)
|
2002-08-02 04:57:19 +00:00
|
|
|
# define __pack__
|
2004-08-01 13:01:39 +00:00
|
|
|
#elif defined(macintosh)
|
|
|
|
# pragma options align=packed
|
|
|
|
# define __pack__
|
2003-11-26 12:26:36 +00:00
|
|
|
#else
|
|
|
|
# error d2x will not work without packed structures
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef _MSC_VER
|
|
|
|
# define inline __inline
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef PACKAGE_STRING
|
|
|
|
# define PACKAGE_STRING "d2x"
|
2001-01-19 03:30:16 +00:00
|
|
|
#endif
|
|
|
|
|
2003-01-02 23:13:21 +00:00
|
|
|
#endif //_TYPES_H
|
|
|
|
|