MrSID Decode SDK for Raster Reference Manual  9.5.1.4427
lt_platform.h
Go to the documentation of this file.
1 /* $Id$ */
2 /* //////////////////////////////////////////////////////////////////////////
3 // //
4 // This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue, //
5 // Suite 200, Seattle, WA 98104. Unauthorized use or distribution //
6 // prohibited. Access to and use of this code is permitted only under //
7 // license from LizardTech, Inc. Portions of the code are protected by //
8 // US and foreign patents and other filings. All Rights Reserved. //
9 // //
11 /* PUBLIC */
12 
13 
36 #ifndef LT_PLATFORM_H
37 #define LT_PLATFORM_H
38 
39 /* Check Compiler */
40 #if (defined(__GNUC__) || defined(__GNUG__)) && (3 <= __GNUC__ && __GNUC__ <= 4)
41  #define LT_COMPILER_GNU 1
42 
43  #if defined(__GNUC__)
44  #define LT_COMPILER_GCC 1
45  #endif
46  #if defined(__GNUG__)
47  #define LT_COMPILER_GXX 1
48  #endif
49 
50  #if(__GNUC__ == 3)
51  #define LT_COMPILER_GCC3 1
52  #else
53  #define LT_COMPILER_GCC4 1
54  #endif
55 
56  #define LT_DEPRECATED(NEW) __attribute__ ((__deprecated__))
57 
58 #elif defined (__SUNPRO_CC) || defined(__SUNPRO_C)
59  #define LT_COMPILER_SUN 1
60 
61  #if defined (__SUNPRO_CC)
62  #define LT_COMPILER_SUNPRO_CC 1
63  #endif
64  #if defined(__SUNPRO_C)
65  #define LT_COMPILER_SUNPRO_C 1
66  #endif
67 
68  #define LT_DEPRECATED(NEW)
69 
70 #elif defined(_MSC_VER) && (1300 <= _MSC_VER && _MSC_VER <= 1900)
71  #define LT_COMPILER_MS 1
72  #if _MSC_VER < 1400
73  #define LT_COMPILER_MS7 1
74  #elif _MSC_VER < 1500
75  #define LT_COMPILER_MS8 1
76  #elif _MSC_VER < 1600
77  #define LT_COMPILER_MS9 1
78  #elif _MSC_VER < 1700
79  #define LT_COMPILER_MS10 1
80  #elif _MSC_VER < 1800
81  #define LT_COMPILER_MS11 1
82  #elif _MSC_VER < 1900
83  #define LT_COMPILER_MS12 1
84  #else
85  #define LT_COMPILER_MS14 1
86  #endif
87 
88  #if !defined(_CRT_SECURE_NO_DEPRECATE) && _MSC_VER >= 1400
89  #define _CRT_SECURE_NO_DEPRECATE
90  #define _CRT_SECURE_NO_WARNINGS
91  #define _CRT_NONSTDC_NO_WARNINGS
92  #define LT_DEPRECATED(NEW) __declspec(deprecated("was declared deprecated and replaced by "#NEW))
93  #else
94  #define LT_DEPRECATED(NEW)
95  #endif
96 
97 #else
98  #error PLATFORM ERROR: unknown compiler
99 #endif
100 
101 /* Check Architecture and Endian */
102 /* We do not define LT_BIG_ENDIAN, as that would just confuse things;
103  either you're little endian, or you're not. */
104 
105 #if defined(__ppc) || defined(__ppc__)
106  #define LT_ARCH_PPC 1
107 #elif defined(__ppc64) || defined(__ppc64__)
108  #define LT_ARCH_PPC64 1
109 #elif defined(__sparcv9) || defined(__sparcv9__)
110  #define LT_ARCH_SPARC64 1
111 #elif defined(__sparc) || defined(__sparcv9__)
112  #define LT_ARCH_SPARC 1
113 #elif defined(__i386__) || defined(i386) || \
114  defined(_M_IX86) || defined(_X86_) || defined(x86)
115  #define LT_ARCH_IA32 1
116  #define LT_LITTLE_ENDIAN
117 #elif defined(__x86_64) || defined(__x86_64__) || \
118  defined(__amd64) || defined(__amd64__) || \
119  defined(_M_AMD64)
120  #define LT_ARCH_AMD64 1 /* x86 w/ 64-extensions ("x86-64") */
121  #define LT_LITTLE_ENDIAN
122 #elif defined(__hppa__)
123  #define LT_ARCH_PARISC 1
124 #elif defined(_M_IX86)
125  #define LT_ARCH_IA64 1 /* Itanium */
126  #define LT_LITTLE_ENDIAN
127 #elif defined(ARM) || defined(_ARM_) || defined(__arm__)
128  #define LT_ARCH_ARM 1
129  #define LT_LITTLE_ENDIAN
130 #elif defined(__arm64) || defined(__arm64__)
131  #define LT_ARCH_ARM64 1
132  #define LT_LITTLE_ENDIAN
133 #elif defined(__MIPSEL__)
134  #define LT_ARCH_MIPSEL 1
135  #define LT_LITTLE_ENDIAN
136 #else
137  #error PLATFORM ERROR: unknown architecture
138 #endif
139 
140 /* Check OS */
141 #if defined(_WIN64) || defined(WIN64)
142  #define LT_OS_WIN 1
143  #define LT_OS_WIN64 1
144 #elif defined(_WIN32_WCE)
145  #define LT_OS_WIN 1
146  #define LT_OS_WINCE 1
147 #elif defined(_WIN32) || defined(WIN32)
148  #define LT_OS_WIN 1
149  #define LT_OS_WIN32 1
150 #elif defined(__APPLE__) && defined(__MACH__)
151  #define LT_OS_UNIX 1
152  #define LT_OS_DARWIN 1
153 #elif defined(__hpux)
154  #define LT_OS_UNIX 1
155  #define LT_OS_HPUX 1
156 #elif defined (__sun)
157  #define LT_OS_UNIX 1
158  #define LT_OS_SUNOS 1
159 #elif defined (linux) || defined (__linux__) || defined (__linux)
160  #define LT_OS_UNIX 1
161  #define LT_OS_LINUX 1
162 #else
163  #error PLATFORM ERROR: unsupported platform
164 #endif
165 
166 #if !defined(LT_OS_WIN) && !defined(LT_OS_UNIX)
167  #error PLATFORM ERROR: set LT_OS_WIN or LT_OS_UNIX
168 #endif
169 
170 /* backwards compatability, deprecated stuff */
171 
172 #if defined(LT_LITTLE_ENDIAN) && !defined(_LITTLE_ENDIAN)
173  /* this is deprecated! */
174  #define _LITTLE_ENDIAN
175 #endif
176 
177 #ifdef LT_OS_UNIX
178  #define LT_UNIX 1
179 #endif
180 
181 #endif /* LT_PLATFORM_H */
182 

LizardTech