MrSID Decode SDK for Raster Reference Manual  9.5.4.4709
lt_platform.h
Go to the documentation of this file.
00001 /* $Id$ */
00002 /* //////////////////////////////////////////////////////////////////////////
00003 //                                                                         //
00004 // This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
00005 // Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
00006 // prohibited.  Access to and use of this code is permitted only under     //
00007 // license from LizardTech, Inc.  Portions of the code are protected by    //
00008 // US and foreign patents and other filings. All Rights Reserved.          //
00009 //                                                                         //
00011 /* PUBLIC */
00012 
00013 
00036 #ifndef LT_PLATFORM_H
00037 #define LT_PLATFORM_H
00038 
00039 /* Check Compiler */
00040 #if (defined(__GNUC__) || defined(__GNUG__)) && (3 <= __GNUC__ && __GNUC__ <= 5)
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    #elif(__GNUC__ == 4)
00053       #define LT_COMPILER_GCC4 1
00054    #else
00055       #define LT_COMPILER_GCC5 1
00056    #endif
00057 
00058    #define LT_DEPRECATED(NEW) __attribute__ ((__deprecated__))
00059 
00060 #elif defined (__SUNPRO_CC) || defined(__SUNPRO_C) 
00061    #define LT_COMPILER_SUN 1
00062 
00063    #if defined (__SUNPRO_CC)
00064       #define LT_COMPILER_SUNPRO_CC 1
00065    #endif
00066    #if defined(__SUNPRO_C)
00067       #define LT_COMPILER_SUNPRO_C 1
00068    #endif
00069 
00070    #define LT_DEPRECATED(NEW)
00071 
00072 #elif defined(_MSC_VER) &&  (1300 <= _MSC_VER && _MSC_VER <= 1910)  
00073    #define LT_COMPILER_MS 1
00074    #if _MSC_VER < 1400
00075       #define LT_COMPILER_MS7 1
00076    #elif _MSC_VER < 1500
00077       #define LT_COMPILER_MS8 1
00078    #elif _MSC_VER < 1600
00079       #define LT_COMPILER_MS9 1
00080    #elif _MSC_VER < 1700
00081       #define LT_COMPILER_MS10 1
00082    #elif _MSC_VER < 1800
00083       #define LT_COMPILER_MS11 1
00084    #elif _MSC_VER < 1900
00085       #define LT_COMPILER_MS12 1
00086    #elif _MSC_VER < 1910
00087       #define LT_COMPILER_MS14 1
00088    #else
00089       #define LT_COMPILER_MS17 1
00090    #endif
00091 
00092    #if !defined(_CRT_SECURE_NO_DEPRECATE) && _MSC_VER >= 1400
00093       #define _CRT_SECURE_NO_DEPRECATE
00094       #define _CRT_SECURE_NO_WARNINGS
00095       #define _CRT_NONSTDC_NO_WARNINGS
00096       #define LT_DEPRECATED(NEW) __declspec(deprecated("was declared deprecated and replaced by "#NEW))
00097    #else
00098       #define LT_DEPRECATED(NEW)
00099    #endif
00100 
00101 #else
00102    #error PLATFORM ERROR: unknown compiler
00103 #endif
00104 
00105 /* Check Architecture and Endian */
00106 /* We do not define LT_BIG_ENDIAN, as that would just confuse things;
00107    either you're little endian, or you're not. */
00108 
00109 #if defined(__ppc) || defined(__ppc__)
00110    #define LT_ARCH_PPC 1
00111 #elif defined(__ppc64) || defined(__ppc64__)
00112    #define LT_ARCH_PPC64 1
00113 #elif defined(__sparcv9) || defined(__sparcv9__)
00114    #define LT_ARCH_SPARC64 1
00115 #elif defined(__sparc) || defined(__sparcv9__)
00116    #define LT_ARCH_SPARC 1
00117 #elif defined(__i386__) || defined(i386) || \
00118       defined(_M_IX86) || defined(_X86_) || defined(x86)
00119    #define LT_ARCH_IA32 1
00120    #define LT_LITTLE_ENDIAN
00121 #elif defined(__x86_64) || defined(__x86_64__) || \
00122       defined(__amd64) || defined(__amd64__) || \
00123       defined(_M_AMD64)
00124    #define LT_ARCH_AMD64 1  /* x86 w/ 64-extensions ("x86-64") */
00125    #define LT_LITTLE_ENDIAN
00126 #elif defined(__hppa__)
00127    #define LT_ARCH_PARISC 1
00128 #elif defined(_M_IX86)
00129    #define LT_ARCH_IA64 1   /* Itanium */
00130    #define LT_LITTLE_ENDIAN
00131 #elif defined(ARM) || defined(_ARM_) || defined(__arm__)
00132    #define LT_ARCH_ARM 1
00133    #define LT_LITTLE_ENDIAN
00134 #elif defined(__arm64) || defined(__arm64__) || defined (__ARM_NEON)
00135    #define LT_ARCH_ARM64 1
00136    #define LT_LITTLE_ENDIAN
00137 #elif defined(__MIPSEL__)
00138    #define LT_ARCH_MIPSEL 1
00139    #define LT_LITTLE_ENDIAN
00140 #else
00141    #error PLATFORM ERROR: unknown architecture
00142 #endif
00143 
00144 /* Check OS */
00145 #if defined(_WIN64) || defined(WIN64)
00146    #define LT_OS_WIN 1
00147    #define LT_OS_WIN64 1
00148 #elif defined(_WIN32_WCE)
00149    #define LT_OS_WIN 1
00150    #define LT_OS_WINCE 1
00151 #elif defined(_WIN32) || defined(WIN32)
00152    #define LT_OS_WIN 1
00153    #define LT_OS_WIN32 1
00154 #elif defined(__APPLE__) && defined(__MACH__)
00155    #define LT_OS_UNIX 1
00156    #define LT_OS_DARWIN 1
00157 #elif defined(__hpux) 
00158    #define LT_OS_UNIX 1
00159    #define LT_OS_HPUX 1
00160 #elif defined (__sun)
00161    #define LT_OS_UNIX 1
00162    #define LT_OS_SUNOS 1
00163 #elif defined (linux) || defined (__linux__) || defined (__linux)
00164    #define LT_OS_UNIX 1
00165    #define LT_OS_LINUX 1
00166 #else
00167    #error PLATFORM ERROR: unsupported platform
00168 #endif
00169 
00170 #if !defined(LT_OS_WIN) && !defined(LT_OS_UNIX)
00171    #error PLATFORM ERROR: set LT_OS_WIN or LT_OS_UNIX
00172 #endif
00173 
00174 /* backwards compatability, deprecated stuff */
00175 
00176 #if defined(LT_LITTLE_ENDIAN) && !defined(_LITTLE_ENDIAN)
00177    /* this is deprecated! */
00178    #define _LITTLE_ENDIAN
00179 #endif
00180 
00181 #ifdef LT_OS_UNIX
00182    #define LT_UNIX 1
00183 #endif
00184 
00185 #endif /* LT_PLATFORM_H */
00186