Descent3/lib/pstypes.h

46 lines
1.1 KiB
C
Raw Normal View History

2024-04-16 03:43:29 +00:00
#ifndef _TYPES_H
#define _TYPES_H
#include <stdlib.h>
2024-04-16 18:56:40 +00:00
// define unsigned types;
2024-04-16 03:43:29 +00:00
typedef unsigned char ubyte;
typedef signed char sbyte;
typedef unsigned short ushort;
typedef unsigned int uint;
typedef unsigned long ulong;
2024-04-16 18:56:40 +00:00
#ifdef _MSC_VER // only Visual C++ has __int64
typedef __int64 longlong;
2024-04-16 03:43:29 +00:00
#else
typedef long long longlong;
#endif
#ifndef NULL
#define NULL 0
#endif
2024-04-16 18:56:40 +00:00
// The maximum length for a file name, including extension. It *does not* include the
// terminating NULL, so a buffer to hold a filename needs to be PSFILENAME_LEN+1 bytes long.
#define PSFILENAME_LEN 35
2024-04-16 03:43:29 +00:00
2024-04-16 18:56:40 +00:00
// The maximum length of a path (or path+filename). The seems (from looking at the code) to
// include the terminating NULL. lengthened to 512 to prevent problems with some long pathnames.
#define PSPATHNAME_LEN _MAX_PATH
2024-04-16 03:43:29 +00:00
#if !defined(__APPLE__)
2024-04-16 18:56:40 +00:00
#define HOST_BIGENDIAN @HOST_BIGENDIAN @
#else
#if defined(__BIG_ENDIAN__)
#define HOST_BIGENDIAN 1
#define MACOSXPPC 1
#elif defined(__LITTLE_ENDIAN__)
#define HOST_BIGENDIAN 0
#define MACOSX86 1
2024-04-16 03:43:29 +00:00
#else
2024-04-16 18:56:40 +00:00
#error "Unknown HOST_BIGENDIAN!"
2024-04-16 03:43:29 +00:00
#endif
#endif
2024-04-16 18:56:40 +00:00
#endif