lugre_platform.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef LUGRE_PLATFORM_H
00026 #define LUGRE_PLATFORM_H
00027
00028
00029
00030 #define LUGRE_PLATFORM_WIN32 1
00031 #define LUGRE_PLATFORM_LINUX 2
00032 #define LUGRE_PLATFORM_APPLE 3
00033
00034 #define LUGRE_COMPILER_MSVC 1
00035 #define LUGRE_COMPILER_GNUC 2
00036 #define LUGRE_COMPILER_BORL 3
00037
00038 #define LUGRE_ENDIAN_LITTLE 1
00039 #define LUGRE_ENDIAN_BIG 2
00040
00041 #define LUGRE_ARCHITECTURE_32 1
00042 #define LUGRE_ARCHITECTURE_64 2
00043
00044
00045
00046 #if defined( _MSC_VER )
00047 # define LUGRE_COMPILER LUGRE_COMPILER_MSVC
00048 # define LUGRE_COMP_VER _MSC_VER
00049
00050 #elif defined( __GNUC__ )
00051 # define LUGRE_COMPILER LUGRE_COMPILER_GNUC
00052 # define LUGRE_COMP_VER (((__GNUC__)*100) + \
00053 (__GNUC_MINOR__*10) + \
00054 __GNUC_PATCHLEVEL__)
00055
00056 #elif defined( __BORLANDC__ )
00057 # define LUGRE_COMPILER LUGRE_COMPILER_BORL
00058 # define LUGRE_COMP_VER __BCPLUSPLUS__
00059 # define __FUNCTION__ __FUNC__
00060 #else
00061 # pragma error "No known compiler. Abort! Abort!"
00062
00063 #endif
00064
00065
00066
00067 #if defined( __WIN32__ ) || defined( _WIN32 )
00068 # define LUGRE_PLATFORM LUGRE_PLATFORM_WIN32
00069
00070 #elif defined( __APPLE_CC__)
00071 # define LUGRE_PLATFORM LUGRE_PLATFORM_APPLE
00072
00073 #else
00074 # define LUGRE_PLATFORM LUGRE_PLATFORM_LINUX
00075 #endif
00076
00077
00078
00079 #if defined(__x86_64__) || defined(_M_X64) || defined(__powerpc64__) || defined(__alpha__) || defined(__ia64__) || defined(__s390__) || defined(__s390x__)
00080 # define LUGRE_ARCH_TYPE LUGRE_ARCHITECTURE_64
00081 #else
00082 # define LUGRE_ARCH_TYPE LUGRE_ARCHITECTURE_32
00083 #endif
00084
00085
00086
00087
00088
00089 #ifdef LUGRE_CONFIG_BIG_ENDIAN
00090 # define LUGRE_ENDIAN LUGRE_ENDIAN_BIG
00091 #else
00092 # define LUGRE_ENDIAN LUGRE_ENDIAN_LITTLE
00093 #endif
00094
00095 namespace Lugre {
00096
00097
00098 typedef unsigned int uint32;
00099 typedef unsigned short uint16;
00100 typedef unsigned char uint8;
00101
00102 #if LUGRE_COMPILER == LUGRE_COMPILER_MSVC
00103 typedef unsigned __int64 uint64;
00104 #else
00105 typedef unsigned long long uint64;
00106 #endif
00107
00108
00109 typedef int int32;
00110 typedef short int16;
00111 typedef char int8;
00112 #if LUGRE_COMPILER == LUGRE_COMPILER_MSVC
00113 typedef __int64 int64;
00114 #else
00115 typedef long long int64;
00116 #endif
00117
00118 }
00119
00120
00121
00122
00123
00124
00125 #if LUGRE_PLATFORM == LUGRE_PLATFORM_APPLE
00126 #include <Carbon/Carbon.h>
00127 #endif
00128
00129
00130
00131
00132
00133
00134
00135 #ifdef WIN32
00136 #ifndef snprintf
00137 #ifndef MINGW
00138 int snprintf (char *str, int n, char *fmt, ...);
00139 #define DEFINE_SNPRINTF
00140 #endif
00141 #endif
00142
00143
00144 #endif
00145
00146
00147 #endif