llpreprocessor.h

Go to the documentation of this file.
00001 
00033 #ifndef LLPREPROCESSOR_H
00034 #define LLPREPROCESSOR_H
00035 
00036 // Figure out endianness of platform
00037 #ifdef LL_LINUX
00038 #define __ENABLE_WSTRING
00039 #include <endian.h>
00040 #endif  //      LL_LINUX
00041 
00042 #if (defined(LL_WINDOWS) || (defined(LL_LINUX) && (__BYTE_ORDER == __LITTLE_ENDIAN)) || (defined(LL_DARWIN) && defined(__LITTLE_ENDIAN__)))
00043 #define LL_LITTLE_ENDIAN 1
00044 #else
00045 #define LL_BIG_ENDIAN 1
00046 #endif
00047 
00048 // Per-compiler switches
00049 #ifdef __GNUC__
00050 #define LL_FORCE_INLINE inline __attribute__((always_inline))
00051 #else
00052 #define LL_FORCE_INLINE __forceinline
00053 #endif
00054 
00055 // Figure out differences between compilers
00056 #if defined(__GNUC__)
00057         #define GCC_VERSION (__GNUC__ * 10000 \
00058                                                 + __GNUC_MINOR__ * 100 \
00059                                                 + __GNUC_PATCHLEVEL__)
00060         #ifndef LL_GNUC
00061                 #define LL_GNUC 1
00062         #endif
00063 #elif defined(__MSVC_VER__) || defined(_MSC_VER)
00064         #ifndef LL_MSVC
00065                 #define LL_MSVC 1
00066         #endif
00067 #endif
00068 
00069 // Deal with minor differences on Unixy OSes.
00070 #if LL_DARWIN || LL_LINUX
00071         // Different name, same functionality.
00072         #define stricmp strcasecmp
00073         #define strnicmp strncasecmp
00074 
00075         // Not sure why this is different, but...
00076         #ifndef MAX_PATH
00077                 #define MAX_PATH PATH_MAX
00078         #endif  //      not MAX_PATH
00079 
00080 #endif
00081 
00082 
00083 // Deal with the differeneces on Windows
00084 #if LL_MSVC
00085 namespace snprintf_hack
00086 {
00087         int snprintf(char *str, size_t size, const char *format, ...);
00088 }
00089 
00090 // #define snprintf safe_snprintf               /* Flawfinder: ignore */
00091 using snprintf_hack::snprintf;
00092 #endif  // LL_MSVC
00093 
00094 // Static linking with apr on windows needs to be declared.
00095 #ifdef LL_WINDOWS
00096 #ifndef APR_DECLARE_STATIC
00097 #define APR_DECLARE_STATIC // For APR on Windows
00098 #endif
00099 #ifndef APU_DECLARE_STATIC
00100 #define APU_DECLARE_STATIC // For APR util on Windows
00101 #endif
00102 #endif
00103 
00104 #if defined(LL_WINDOWS)
00105 #define BOOST_REGEX_NO_LIB 1
00106 #define CURL_STATICLIB 1
00107 
00108 //#define LL_LCD_COMPILE 0
00109 
00110 #endif  //      LL_WINDOWS
00111 
00112 
00113 // Deal with VC6 problems
00114 #if LL_MSVC
00115 #pragma warning( 3           : 4701 )   // "local variable used without being initialized"  Treat this as level 3, not level 4.
00116 #pragma warning( 3           : 4702 )   // "unreachable code"  Treat this as level 3, not level 4.
00117 #pragma warning( 3           : 4189 )   // "local variable initialized but not referenced"  Treat this as level 3, not level 4.
00118 //#pragma warning( 3    : 4018 )        // "signed/unsigned mismatch"  Treat this as level 3, not level 4.
00119 #pragma warning( 3       : 4265 )       // "class has virtual functions, but destructor is not virtual"
00120 #pragma warning( disable : 4786 )       // silly MS warning deep inside their <map> include file
00121 #pragma warning( disable : 4284 )       // silly MS warning deep inside their <map> include file
00122 #pragma warning( disable : 4503 )       // 'decorated name length exceeded, name was truncated'. Does not seem to affect compilation.
00123 #pragma warning( disable : 4800 )       // 'BOOL' : forcing value to bool 'true' or 'false' (performance warning)
00124 #pragma warning( disable : 4996 )       // warning: deprecated
00125 #endif  //      LL_MSVC
00126 
00127 #endif  //      not LL_LINDEN_PREPROCESSOR_H

Generated on Fri May 16 08:32:04 2008 for SecondLife by  doxygen 1.5.5