MrSID Decode SDK for Raster Reference Manual  9.0.0.3864
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__ <= 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 <= 1700)  
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    #else
00081       #define LT_COMPILER_MS11 1
00082    #endif
00083 
00084    #if !defined(_CRT_SECURE_NO_DEPRECATE) && _MSC_VER >= 1400
00085       #define _CRT_SECURE_NO_DEPRECATE
00086       #define _CRT_SECURE_NO_WARNINGS
00087       #define _CRT_NONSTDC_NO_WARNINGS
00088       #define LT_DEPRECATED(NEW) __declspec(deprecated("was declared deprecated and replaced by "#NEW))
00089    #else
00090       #define LT_DEPRECATED(NEW)
00091    #endif
00092 
00093 #else
00094    #error PLATFORM ERROR: unknown compiler
00095 #endif
00096 
00097 /* Check Architecture and Endian */
00098 /* We do not define LT_BIG_ENDIAN, as that would just confuse things;
00099    either you're little endian, or you're not. */
00100 
00101 #if defined(__ppc) || defined(__ppc__)
00102    #define LT_ARCH_PPC 1
00103 #elif defined(__ppc64) || defined(__ppc64__)
00104    #define LT_ARCH_PPC64 1
00105 #elif defined(__sparcv9) || defined(__sparcv9__)
00106    #define LT_ARCH_SPARC64 1
00107 #elif defined(__sparc) || defined(__sparcv9__)
00108    #define LT_ARCH_SPARC 1
00109 #elif defined(__i386__) || defined(i386) || \
00110       defined(_M_IX86) || defined(_X86_) || defined(x86)
00111    #define LT_ARCH_IA32 1
00112    #define LT_LITTLE_ENDIAN
00113 #elif defined(__x86_64) || defined(__x86_64__) || \
00114       defined(__amd64) || defined(__amd64__) || \
00115       defined(_M_AMD64)
00116    #define LT_ARCH_AMD64 1  /* x86 w/ 64-extensions ("x86-64") */
00117    #define LT_LITTLE_ENDIAN
00118 #elif defined(__hppa__)
00119    #define LT_ARCH_PARISC 1
00120 #elif defined(_M_IX86)
00121    #define LT_ARCH_IA64 1   /* Itanium */
00122    #define LT_LITTLE_ENDIAN
00123 #elif defined(ARM) || defined(_ARM_) || defined(__arm__)
00124    #define LT_ARCH_ARM 1
00125    #define LT_LITTLE_ENDIAN
00126 #elif defined(__arm64) || defined(__arm64__)
00127    #define LT_ARCH_ARM64 1
00128    #define LT_LITTLE_ENDIAN
00129 #else
00130    #error PLATFORM ERROR: unknown architecture
00131 #endif
00132 
00133 /* Check OS */
00134 #if defined(_WIN64) || defined(WIN64)
00135    #define LT_OS_WIN 1
00136    #define LT_OS_WIN64 1
00137 #elif defined(_WIN32_WCE)
00138    #define LT_OS_WIN 1
00139    #define LT_OS_WINCE 1
00140 #elif defined(_WIN32) || defined(WIN32)
00141    #define LT_OS_WIN 1
00142    #define LT_OS_WIN32 1
00143 #elif defined(__APPLE__) && defined(__MACH__)
00144    #define LT_OS_UNIX 1
00145    #define LT_OS_DARWIN 1
00146 #elif defined(__hpux) 
00147    #define LT_OS_UNIX 1
00148    #define LT_OS_HPUX 1
00149 #elif defined (__sun)
00150    #define LT_OS_UNIX 1
00151    #define LT_OS_SUNOS 1
00152 #elif defined (linux) || defined (__linux__) || defined (__linux)
00153    #define LT_OS_UNIX 1
00154    #define LT_OS_LINUX 1
00155 #else
00156    #error PLATFORM ERROR: unsupported platform
00157 #endif
00158 
00159 #if !defined(LT_OS_WIN) && !defined(LT_OS_UNIX)
00160    #error PLATFORM ERROR: set LT_OS_WIN or LT_OS_UNIX
00161 #endif
00162 
00163 /* backwards compatability, deprecated stuff */
00164 
00165 #if defined(LT_LITTLE_ENDIAN) && !defined(_LITTLE_ENDIAN)
00166    /* this is deprecated! */
00167    #define _LITTLE_ENDIAN
00168 #endif
00169 
00170 #ifdef LT_OS_UNIX
00171    #define LT_UNIX 1
00172 #endif
00173 
00174 #endif /* LT_PLATFORM_H */
00175