00001
00002
00003
00004
00005
00006
00007
00008
00009
00011
00012
00013
00036 #ifndef LT_PLATFORM_H
00037 #define LT_PLATFORM_H
00038
00039
00040 #if (defined(__GNUC__) || defined(__GNUG__)) && (3 <= __GNUC__ && __GNUC__ <= 4)
00041 #define LT_COMPILER_GNU 1
00042
00043 #if defined(__GNUC__)
00044 #define LT_COMPILER_GCC 1
00045 #endif
00046 #if defined(__GNUG__)
00047 #define LT_COMPILER_GXX 1
00048 #endif
00049
00050 #if(__GNUC__ == 3)
00051 #define LT_COMPILER_GCC3 1
00052 #else
00053 #define LT_COMPILER_GCC4 1
00054 #endif
00055
00056 #define LT_DEPRECATED(NEW) __attribute__ ((__deprecated__))
00057
00058 #elif defined (__SUNPRO_CC) || defined(__SUNPRO_C)
00059 #define LT_COMPILER_SUN 1
00060
00061 #if defined (__SUNPRO_CC)
00062 #define LT_COMPILER_SUNPRO_CC 1
00063 #endif
00064 #if defined(__SUNPRO_C)
00065 #define LT_COMPILER_SUNPRO_C 1
00066 #endif
00067
00068 #define LT_DEPRECATED(NEW)
00069
00070 #elif defined(_MSC_VER) && (1300 <= _MSC_VER && _MSC_VER <= 1800)
00071 #define LT_COMPILER_MS 1
00072 #if _MSC_VER < 1400
00073 #define LT_COMPILER_MS7 1
00074 #elif _MSC_VER < 1500
00075 #define LT_COMPILER_MS8 1
00076 #elif _MSC_VER < 1600
00077 #define LT_COMPILER_MS9 1
00078 #elif _MSC_VER < 1700
00079 #define LT_COMPILER_MS10 1
00080 #elif _MSC_VER < 1800
00081 #define LT_COMPILER_MS11 1
00082 #else
00083 #define LT_COMPILER_MS12 1
00084 #endif
00085
00086 #if !defined(_CRT_SECURE_NO_DEPRECATE) && _MSC_VER >= 1400
00087 #define _CRT_SECURE_NO_DEPRECATE
00088 #define _CRT_SECURE_NO_WARNINGS
00089 #define _CRT_NONSTDC_NO_WARNINGS
00090 #define LT_DEPRECATED(NEW) __declspec(deprecated("was declared deprecated and replaced by "#NEW))
00091 #else
00092 #define LT_DEPRECATED(NEW)
00093 #endif
00094
00095 #else
00096 #error PLATFORM ERROR: unknown compiler
00097 #endif
00098
00099
00100
00101
00102
00103 #if defined(__ppc) || defined(__ppc__)
00104 #define LT_ARCH_PPC 1
00105 #elif defined(__ppc64) || defined(__ppc64__)
00106 #define LT_ARCH_PPC64 1
00107 #elif defined(__sparcv9) || defined(__sparcv9__)
00108 #define LT_ARCH_SPARC64 1
00109 #elif defined(__sparc) || defined(__sparcv9__)
00110 #define LT_ARCH_SPARC 1
00111 #elif defined(__i386__) || defined(i386) || \
00112 defined(_M_IX86) || defined(_X86_) || defined(x86)
00113 #define LT_ARCH_IA32 1
00114 #define LT_LITTLE_ENDIAN
00115 #elif defined(__x86_64) || defined(__x86_64__) || \
00116 defined(__amd64) || defined(__amd64__) || \
00117 defined(_M_AMD64)
00118 #define LT_ARCH_AMD64 1
00119 #define LT_LITTLE_ENDIAN
00120 #elif defined(__hppa__)
00121 #define LT_ARCH_PARISC 1
00122 #elif defined(_M_IX86)
00123 #define LT_ARCH_IA64 1
00124 #define LT_LITTLE_ENDIAN
00125 #elif defined(ARM) || defined(_ARM_) || defined(__arm__)
00126 #define LT_ARCH_ARM 1
00127 #define LT_LITTLE_ENDIAN
00128 #elif defined(__arm64) || defined(__arm64__)
00129 #define LT_ARCH_ARM64 1
00130 #define LT_LITTLE_ENDIAN
00131 #else
00132 #error PLATFORM ERROR: unknown architecture
00133 #endif
00134
00135
00136 #if defined(_WIN64) || defined(WIN64)
00137 #define LT_OS_WIN 1
00138 #define LT_OS_WIN64 1
00139 #elif defined(_WIN32_WCE)
00140 #define LT_OS_WIN 1
00141 #define LT_OS_WINCE 1
00142 #elif defined(_WIN32) || defined(WIN32)
00143 #define LT_OS_WIN 1
00144 #define LT_OS_WIN32 1
00145 #elif defined(__APPLE__) && defined(__MACH__)
00146 #define LT_OS_UNIX 1
00147 #define LT_OS_DARWIN 1
00148 #elif defined(__hpux)
00149 #define LT_OS_UNIX 1
00150 #define LT_OS_HPUX 1
00151 #elif defined (__sun)
00152 #define LT_OS_UNIX 1
00153 #define LT_OS_SUNOS 1
00154 #elif defined (linux) || defined (__linux__) || defined (__linux)
00155 #define LT_OS_UNIX 1
00156 #define LT_OS_LINUX 1
00157 #else
00158 #error PLATFORM ERROR: unsupported platform
00159 #endif
00160
00161 #if !defined(LT_OS_WIN) && !defined(LT_OS_UNIX)
00162 #error PLATFORM ERROR: set LT_OS_WIN or LT_OS_UNIX
00163 #endif
00164
00165
00166
00167 #if defined(LT_LITTLE_ENDIAN) && !defined(_LITTLE_ENDIAN)
00168
00169 #define _LITTLE_ENDIAN
00170 #endif
00171
00172 #ifdef LT_OS_UNIX
00173 #define LT_UNIX 1
00174 #endif
00175
00176 #endif
00177