|
|
2184c4 |
/* support use of these headers by non-native projects */
|
|
|
2184c4 |
#if defined(MIDIPIX_WIN32)
|
|
|
2184c4 |
#ifndef __NT32
|
|
|
2184c4 |
#define __NT32
|
|
|
2184c4 |
#endif
|
|
|
2184c4 |
#elif defined(MIDIPIX_WIN64)
|
|
|
2184c4 |
#ifndef __NT64
|
|
|
2184c4 |
#define __NT64
|
|
|
2184c4 |
#endif
|
|
|
2184c4 |
#endif
|
|
|
2184c4 |
|
|
|
2184c4 |
|
|
|
2184c4 |
/* avoid source and/or header mix-ups */
|
|
|
2184c4 |
#if (defined(__WIN32) || defined(_WIN32) || defined (WIN32)) && !defined(MIDIPIX_WIN32) && !defined(MIDIPIX_WIN64)
|
|
|
2184c4 |
#error __^@^__: Possible mix-up: you have __WIN32 or _WIN32 or WIN32 defined,
|
|
|
2184c4 |
#error __^@^__: but should have defined __NT32 instead.
|
|
|
2184c4 |
#error __^@^__:
|
|
|
2184c4 |
#error __^@^__: if this is a WIN32 project (rather than native or posix), please define MIDIPIX_WIN32
|
|
|
2184c4 |
#error
|
|
|
2184c4 |
#elif (defined(__WIN64) || defined(_WIN64) || defined (WIN64)) && !defined(MIDIPIX_WIN64)
|
|
|
2184c4 |
#error __^@^__: Possible mix-up: you have __WIN64 or _WIN64 or WIN64 defined,
|
|
|
2184c4 |
#error __^@^__: but should have defined __NT64 instead.
|
|
|
2184c4 |
#error __^@^__:
|
|
|
2184c4 |
#error __^@^__: if this is a WIN64 project (rather than native or posix), please define MIDIPIX_WIN64
|
|
|
2184c4 |
#error
|
|
|
2184c4 |
#endif
|
|
|
2184c4 |
|
|
|
2184c4 |
|
|
|
2184c4 |
/* require either __NT32 or __NT64 or __NATIVE_POSIX to be defined... */
|
|
|
2184c4 |
#if !defined(__NT32) && !defined(__NT64) && !defined(__NATIVE_POSIX)
|
|
|
2184c4 |
#error __^@^__: PSXTYPES: explicit definition of either __NT32 or __NT64 or __NATIVE_POSIX is required.
|
|
|
2184c4 |
#endif
|
|
|
2184c4 |
|
|
|
2184c4 |
|
|
|
2184c4 |
/* ...but only one */
|
|
|
2184c4 |
#ifdef __NT32
|
|
|
2184c4 |
#define __NT32_MATCHES 1
|
|
|
2184c4 |
#else
|
|
|
2184c4 |
#define __NT32_MATCHES 0
|
|
|
2184c4 |
#endif
|
|
|
2184c4 |
|
|
|
2184c4 |
#ifdef __NT64
|
|
|
2184c4 |
#define __NT64_MATCHES 1
|
|
|
2184c4 |
#else
|
|
|
2184c4 |
#define __NT64_MATCHES 0
|
|
|
2184c4 |
#endif
|
|
|
2184c4 |
|
|
|
2184c4 |
#ifdef __NATIVE_POSIX
|
|
|
2184c4 |
#define __NATIVE_POSIX_MATCHES 1
|
|
|
2184c4 |
#else
|
|
|
2184c4 |
#define __NATIVE_POSIX_MATCHES 0
|
|
|
2184c4 |
#endif
|
|
|
2184c4 |
|
|
|
2184c4 |
#if (__NT32_MATCHES + __NT64_MATCHES + __NATIVE_POSIX_MATCHES) > 1
|
|
|
2184c4 |
#error __^@^__: PSXTYPES: please choose one platform only...
|
|
|
2184c4 |
#error __^@^__: (currently supported platforms: __NT32, __NT64, __NATIVE_POSIX)
|
|
|
2184c4 |
#endif
|
|
|
2184c4 |
|
|
|
2184c4 |
#undef __NT32_MATCHES
|
|
|
2184c4 |
#undef __NT64_MATCHES
|
|
|
2184c4 |
#undef __NATIVE_POSIX_MATCHES
|
|
|
2184c4 |
|
|
|
2184c4 |
|
|
|
2184c4 |
|
|
|
2184c4 |
/**
|
|
|
2184c4 |
* define arbitrary constants to identify supported compilers;
|
|
|
2184c4 |
* compiler-specific headers will define __COMPILER__ to equal
|
|
|
2184c4 |
* one of the values below (crc of upper-cased compiler name).
|
|
|
2184c4 |
**/
|
|
|
2184c4 |
#define __GCC__ 0xBE154EBB
|
|
|
2184c4 |
#define __MSVC__ 0x25F425ED
|
|
|
2184c4 |
|
|
|
2184c4 |
#if defined(__DEBUG)
|
|
|
2184c4 |
#define __PSX_DEBUG 1
|
|
|
2184c4 |
#else
|
|
|
2184c4 |
#define __PSX_DEBUG 0
|
|
|
2184c4 |
#endif
|
|
|
2184c4 |
|
|
|
2184c4 |
/* single point to load compiler-specific and architecture-specific definitions */
|
|
|
2184c4 |
#if defined(__NATIVE_POSIX)
|
|
|
2184c4 |
#include "__psxtypes.h"
|
|
|
2184c4 |
#elif defined(__NT32) || defined(__NT64)
|
|
|
2184c4 |
#include "__nttypes.h"
|
|
|
2184c4 |
#endif
|