MrSID Decode SDK for Raster Reference Manual  9.0.0.3864
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 <= 1700)
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  #else
81  #define LT_COMPILER_MS11 1
82  #endif
83 
84  #if !defined(_CRT_SECURE_NO_DEPRECATE) && _MSC_VER >= 1400
85  #define _CRT_SECURE_NO_DEPRECATE
86  #define _CRT_SECURE_NO_WARNINGS
87  #define _CRT_NONSTDC_NO_WARNINGS
88  #define LT_DEPRECATED(NEW) __declspec(deprecated("was declared deprecated and replaced by "#NEW))
89  #else
90  #define LT_DEPRECATED(NEW)
91  #endif
92 
93 #else
94  #error PLATFORM ERROR: unknown compiler
95 #endif
96 
97 /* Check Architecture and Endian */
98 /* We do not define LT_BIG_ENDIAN, as that would just confuse things;
99  either you're little endian, or you're not. */
100 
101 #if defined(__ppc) || defined(__ppc__)
102  #define LT_ARCH_PPC 1
103 #elif defined(__ppc64) || defined(__ppc64__)
104  #define LT_ARCH_PPC64 1
105 #elif defined(__sparcv9) || defined(__sparcv9__)
106  #define LT_ARCH_SPARC64 1
107 #elif defined(__sparc) || defined(__sparcv9__)
108  #define LT_ARCH_SPARC 1
109 #elif defined(__i386__) || defined(i386) || \
110  defined(_M_IX86) || defined(_X86_) || defined(x86)
111  #define LT_ARCH_IA32 1
112  #define LT_LITTLE_ENDIAN
113 #elif defined(__x86_64) || defined(__x86_64__) || \
114  defined(__amd64) || defined(__amd64__) || \
115  defined(_M_AMD64)
116  #define LT_ARCH_AMD64 1 /* x86 w/ 64-extensions ("x86-64") */
117  #define LT_LITTLE_ENDIAN
118 #elif defined(__hppa__)
119  #define LT_ARCH_PARISC 1
120 #elif defined(_M_IX86)
121  #define LT_ARCH_IA64 1 /* Itanium */
122  #define LT_LITTLE_ENDIAN
123 #elif defined(ARM) || defined(_ARM_) || defined(__arm__)
124  #define LT_ARCH_ARM 1
125  #define LT_LITTLE_ENDIAN
126 #elif defined(__arm64) || defined(__arm64__)
127  #define LT_ARCH_ARM64 1
128  #define LT_LITTLE_ENDIAN
129 #else
130  #error PLATFORM ERROR: unknown architecture
131 #endif
132 
133 /* Check OS */
134 #if defined(_WIN64) || defined(WIN64)
135  #define LT_OS_WIN 1
136  #define LT_OS_WIN64 1
137 #elif defined(_WIN32_WCE)
138  #define LT_OS_WIN 1
139  #define LT_OS_WINCE 1
140 #elif defined(_WIN32) || defined(WIN32)
141  #define LT_OS_WIN 1
142  #define LT_OS_WIN32 1
143 #elif defined(__APPLE__) && defined(__MACH__)
144  #define LT_OS_UNIX 1
145  #define LT_OS_DARWIN 1
146 #elif defined(__hpux)
147  #define LT_OS_UNIX 1
148  #define LT_OS_HPUX 1
149 #elif defined (__sun)
150  #define LT_OS_UNIX 1
151  #define LT_OS_SUNOS 1
152 #elif defined (linux) || defined (__linux__) || defined (__linux)
153  #define LT_OS_UNIX 1
154  #define LT_OS_LINUX 1
155 #else
156  #error PLATFORM ERROR: unsupported platform
157 #endif
158 
159 #if !defined(LT_OS_WIN) && !defined(LT_OS_UNIX)
160  #error PLATFORM ERROR: set LT_OS_WIN or LT_OS_UNIX
161 #endif
162 
163 /* backwards compatability, deprecated stuff */
164 
165 #if defined(LT_LITTLE_ENDIAN) && !defined(_LITTLE_ENDIAN)
166  /* this is deprecated! */
167  #define _LITTLE_ENDIAN
168 #endif
169 
170 #ifdef LT_OS_UNIX
171  #define LT_UNIX 1
172 #endif
173 
174 #endif /* LT_PLATFORM_H */
175 

LizardTech