diff options
author | Ash Wolf <ninji@wuffs.org> | 2023-01-15 21:50:41 +0000 |
---|---|---|
committer | Ash Wolf <ninji@wuffs.org> | 2023-01-15 21:50:41 +0000 |
commit | a231f5dbb93c60da240a027f2afd8a4797069541 (patch) | |
tree | a6bc68fdc2f1a1fa0000e5cd63a5189f170c226b /sdk_hdrs/CWRuntimeFeatures.h | |
parent | 35d488e972a9dd75ce3867c000405f128b79c615 (diff) | |
download | MWCC-a231f5dbb93c60da240a027f2afd8a4797069541.tar.gz MWCC-a231f5dbb93c60da240a027f2afd8a4797069541.zip |
more cleanup
Diffstat (limited to '')
-rwxr-xr-x | sdk_hdrs/CWRuntimeFeatures.h | 207 |
1 files changed, 206 insertions, 1 deletions
diff --git a/sdk_hdrs/CWRuntimeFeatures.h b/sdk_hdrs/CWRuntimeFeatures.h index 003020c..85c4b4a 100755 --- a/sdk_hdrs/CWRuntimeFeatures.h +++ b/sdk_hdrs/CWRuntimeFeatures.h @@ -1 +1,206 @@ -/*****************************************************************************/
/* Name......: CWRuntimeFeatures.h */
/* Purpose...: Macros to parameterize your runtime environment based on */
/* platform-specific compiler macros. Target/host */
/* configurations to set host/target values as well as */
/* CW_HOST, CW_HOSTOS, CW_HOST_ENDIAN, CW_LINE_ENDING, */
/* and CW_UNIX_TYPE, which is used to discriminate among */
/* the various UNIX versions. */
/* Info......: These settings are common enough to factor into a location */
/* that can be shared by all components, including those */
/* used internally and those shared externally. */
/* Copyright.: ©Copyright 2000 by metrowerks inc. All rights reserved. */
/*****************************************************************************/
#ifndef CW_RuntimeFeatures_H
#define CW_RuntimeFeatures_H
/*************************
* Runtime Definitions *
*************************/
/* host / target processors values used to set HOST macro. */
#define CW_MC68K 1
#define CW_POWERPC 2
#define CW_INTEL 3
#define CW_MIPS 4
#define CW_SPARC 5
#define CW_PA_RISC 6
/* host / target operating systems values used to set CW_HOSTOS macro. */
#define CW_MACOS 1
#define CW_BEWORKS 2
#define CW_UNIX 3
#define CW_MSWIN 4
#define CW_MAGIC 5
#define CW_QNX 11
/* UNIX specialization values used to set the CW_UNIX_TYPE macro. */
#define CW_SOLARIS 32 /* Base value to support bit manipulation */
#define CW_LINUX 33
#define CW_RHAPSODY 34
#define CW_HPUX 35
#define CW_IRIX 36
#define CW_AIX 37
#define CW_FREEBSD 38
/* big/little endian values used to set CW_HOST_ENDIAN macro. */
#define CW_ENDIAN_NEUTRAL 0x7fffffff
#define CW_BIG_ENDIAN 1
#define CW_LITTLE_ENDIAN 2
#define CW_EITHER_ENDIAN 3
/*
** Detemine run-time environment settings based on clues from the
** compile time settings given by specific compilers.
*/
#if defined(__MWERKS__)
/* Metrowerks Compiler */
#if macintosh && __MC68K__
/* 68K MacOS */
#define CW_HOST CW_MC68K
#define CW_HOSTOS CW_MACOS
#define CW_HOST_ENDIAN CW_BIG_ENDIAN
#define CW_LINE_ENDING "\r"
#elif macintosh && __POWERPC__
/* PPC MacOS */
#define CW_HOST CW_POWERPC
#define CW_HOSTOS CW_MACOS
#define CW_HOST_ENDIAN CW_BIG_ENDIAN
#define CW_LINE_ENDING "\r"
#elif __INTEL__ && defined(__BEOS__)
/* x86 BeOS */
#define CW_HOST CW_INTEL
#define CW_HOSTOS CW_BEWORKS
#define CW_HOST_ENDIAN CW_LITTLE_ENDIAN
#define CW_LINE_ENDING "\n"
#elif __INTEL__ && defined(__QNX__)
/* x86 QNX */
#define CW_HOST CW_INTEL
#define CW_HOSTOS CW_QNX
#define CW_HOST_ENDIAN CW_LITTLE_ENDIAN
#define CW_LINE_ENDING "\n"
#elif __INTEL__ && __linux__
/* x86 Linux */
#define CW_HOST CW_INTEL
#define CW_HOSTOS CW_UNIX
#define CW_UNIX_TYPE CW_LINUX
#define CW_HOST_ENDIAN CW_LITTLE_ENDIAN
#define CW_LINE_ENDING "\n"
#elif __INTEL__ /* default to Win32 */
/* x86 Assuming Windows */
#define CW_HOST CW_INTEL
#define CW_HOSTOS CW_MSWIN
#define CW_HOST_ENDIAN CW_LITTLE_ENDIAN
#define CW_LINE_ENDING "\r\n"
#else
#error "UNKNOWN CW COMPILER USE"
#endif
#elif defined(__GNUC__)
/* GCC/EGCS Compiler */
#if __i386__ && __linux__
/* x86 Linux */
#define CW_HOST CW_INTEL
#define CW_HOSTOS CW_UNIX
#define CW_UNIX_TYPE CW_LINUX
#define CW_HOST_ENDIAN CW_LITTLE_ENDIAN
#define CW_LINE_ENDING "\n"
#elif __i386__ && __sun__
/* x86 Solaris */
#define CW_HOST CW_INTEL
#define CW_HOSTOS CW_UNIX
#define CW_UNIX_TYPE CW_SOLARIS
#define CW_HOST_ENDIAN CW_LITTLE_ENDIAN
#define CW_LINE_ENDING "\n"
#elif __sparc__ && __linux__
/* SPARC Linux */
#define CW_HOST CW_SPARC
#define CW_HOSTOS CW_UNIX
#define CW_UNIX_TYPE CW_LINUX
#define CW_HOST_ENDIAN CW_BIG_ENDIAN
#define CW_LINE_ENDING "\n"
#elif __sparc__ && __sun__
/* SPARC Solaris */
#define CW_HOST CW_SPARC
#define CW_HOSTOS CW_UNIX
#define CW_UNIX_TYPE CW_SOLARIS
#define CW_HOST_ENDIAN CW_BIG_ENDIAN
#define CW_LINE_ENDING "\n"
#elif __i386__ && __BEOS__
/* x86 BeOS */
#define CW_HOST CW_INTEL
#define CW_HOSTOS CW_BEWORKS
#define CW_HOST_ENDIAN CW_LITTLE_ENDIAN
#define CW_LINE_ENDING "\n"
#elif __powerpc__ && __linux__
/* PPC Linux */
#define CW_HOST CW_POWERPC
#define CW_HOSTOS CW_UNIX
#define CW_UNIX_TYPE CW_LINUX
#define CW_HOST_ENDIAN CW_BIG_ENDIAN
#define CW_LINE_ENDING "\n"
#else
#error "UNKNOWN GNU COMPILER USE"
#endif
#elif defined(_MSC_VER)
/* Microsoft VC Compiler */
#if defined(_M_IX86)
/* x86 Windows */
#define CW_HOST CW_INTEL
#define CW_HOSTOS CW_MSWIN
#define CW_HOST_ENDIAN CW_LITTLE_ENDIAN
#define CW_LINE_ENDING "\r\n"
#else
#error "UNKNOWN MSC COMPILER USE"
#endif
#else
#error "UNKNOWN COMPILER"
#endif
#endif /* CW_RuntimeFeatures_H */
\ No newline at end of file +/*****************************************************************************/ +/* Name......: CWRuntimeFeatures.h */ +/* Purpose...: Macros to parameterize your runtime environment based on */ +/* platform-specific compiler macros. Target/host */ +/* configurations to set host/target values as well as */ +/* CW_HOST, CW_HOSTOS, CW_HOST_ENDIAN, CW_LINE_ENDING, */ +/* and CW_UNIX_TYPE, which is used to discriminate among */ +/* the various UNIX versions. */ +/* Info......: These settings are common enough to factor into a location */ +/* that can be shared by all components, including those */ +/* used internally and those shared externally. */ +/* Copyright.: �Copyright 2000 by metrowerks inc. All rights reserved. */ +/*****************************************************************************/ + +#ifndef CW_RuntimeFeatures_H +#define CW_RuntimeFeatures_H + + +/************************* + * Runtime Definitions * + *************************/ + + /* host / target processors values used to set HOST macro. */ + +#define CW_MC68K 1 +#define CW_POWERPC 2 +#define CW_INTEL 3 +#define CW_MIPS 4 +#define CW_SPARC 5 +#define CW_PA_RISC 6 + + /* host / target operating systems values used to set CW_HOSTOS macro. */ + +#define CW_MACOS 1 +#define CW_BEWORKS 2 +#define CW_UNIX 3 +#define CW_MSWIN 4 +#define CW_MAGIC 5 +#define CW_QNX 11 + + /* UNIX specialization values used to set the CW_UNIX_TYPE macro. */ + +#define CW_SOLARIS 32 /* Base value to support bit manipulation */ +#define CW_LINUX 33 +#define CW_RHAPSODY 34 +#define CW_HPUX 35 +#define CW_IRIX 36 +#define CW_AIX 37 +#define CW_FREEBSD 38 + + /* big/little endian values used to set CW_HOST_ENDIAN macro. */ + +#define CW_ENDIAN_NEUTRAL 0x7fffffff +#define CW_BIG_ENDIAN 1 +#define CW_LITTLE_ENDIAN 2 +#define CW_EITHER_ENDIAN 3 + +/* +** Detemine run-time environment settings based on clues from the +** compile time settings given by specific compilers. +*/ +#if defined(__MWERKS__) + /* Metrowerks Compiler */ + + #if macintosh && __MC68K__ + + /* 68K MacOS */ + #define CW_HOST CW_MC68K + #define CW_HOSTOS CW_MACOS + #define CW_HOST_ENDIAN CW_BIG_ENDIAN + #define CW_LINE_ENDING "\r" + + #elif macintosh && __POWERPC__ + + /* PPC MacOS */ + #define CW_HOST CW_POWERPC + #define CW_HOSTOS CW_MACOS + #define CW_HOST_ENDIAN CW_BIG_ENDIAN + #define CW_LINE_ENDING "\r" + + #elif __INTEL__ && defined(__BEOS__) + + /* x86 BeOS */ + #define CW_HOST CW_INTEL + #define CW_HOSTOS CW_BEWORKS + #define CW_HOST_ENDIAN CW_LITTLE_ENDIAN + #define CW_LINE_ENDING "\n" + + #elif __INTEL__ && defined(__QNX__) + + /* x86 QNX */ + #define CW_HOST CW_INTEL + #define CW_HOSTOS CW_QNX + #define CW_HOST_ENDIAN CW_LITTLE_ENDIAN + #define CW_LINE_ENDING "\n" + + #elif __INTEL__ && __linux__ + + /* x86 Linux */ + #define CW_HOST CW_INTEL + #define CW_HOSTOS CW_UNIX + #define CW_UNIX_TYPE CW_LINUX + #define CW_HOST_ENDIAN CW_LITTLE_ENDIAN + #define CW_LINE_ENDING "\n" + + #elif __INTEL__ /* default to Win32 */ + + /* x86 Assuming Windows */ + #define CW_HOST CW_INTEL + #define CW_HOSTOS CW_MSWIN + #define CW_HOST_ENDIAN CW_LITTLE_ENDIAN + #define CW_LINE_ENDING "\r\n" + + #else + + #error "UNKNOWN CW COMPILER USE" + + #endif + +#elif defined(__GNUC__) + /* GCC/EGCS Compiler */ + + #if __i386__ && __linux__ + + /* x86 Linux */ + #define CW_HOST CW_INTEL + #define CW_HOSTOS CW_UNIX + #define CW_UNIX_TYPE CW_LINUX + #define CW_HOST_ENDIAN CW_LITTLE_ENDIAN + #define CW_LINE_ENDING "\n" + + #elif __i386__ && __sun__ + + /* x86 Solaris */ + #define CW_HOST CW_INTEL + #define CW_HOSTOS CW_UNIX + #define CW_UNIX_TYPE CW_SOLARIS + #define CW_HOST_ENDIAN CW_LITTLE_ENDIAN + #define CW_LINE_ENDING "\n" + + #elif __sparc__ && __linux__ + + /* SPARC Linux */ + #define CW_HOST CW_SPARC + #define CW_HOSTOS CW_UNIX + #define CW_UNIX_TYPE CW_LINUX + #define CW_HOST_ENDIAN CW_BIG_ENDIAN + #define CW_LINE_ENDING "\n" + + #elif __sparc__ && __sun__ + + /* SPARC Solaris */ + #define CW_HOST CW_SPARC + #define CW_HOSTOS CW_UNIX + #define CW_UNIX_TYPE CW_SOLARIS + #define CW_HOST_ENDIAN CW_BIG_ENDIAN + #define CW_LINE_ENDING "\n" + + #elif __i386__ && __BEOS__ + + /* x86 BeOS */ + #define CW_HOST CW_INTEL + #define CW_HOSTOS CW_BEWORKS + #define CW_HOST_ENDIAN CW_LITTLE_ENDIAN + #define CW_LINE_ENDING "\n" + + #elif __powerpc__ && __linux__ + + /* PPC Linux */ + #define CW_HOST CW_POWERPC + #define CW_HOSTOS CW_UNIX + #define CW_UNIX_TYPE CW_LINUX + #define CW_HOST_ENDIAN CW_BIG_ENDIAN + #define CW_LINE_ENDING "\n" + + #else + + #error "UNKNOWN GNU COMPILER USE" + + #endif + +#elif defined(_MSC_VER) + /* Microsoft VC Compiler */ + + #if defined(_M_IX86) + + /* x86 Windows */ + #define CW_HOST CW_INTEL + #define CW_HOSTOS CW_MSWIN + #define CW_HOST_ENDIAN CW_LITTLE_ENDIAN + #define CW_LINE_ENDING "\r\n" + + #else + + #error "UNKNOWN MSC COMPILER USE" + + #endif + +#else + + #error "UNKNOWN COMPILER" + +#endif + + +#endif /* CW_RuntimeFeatures_H */ |