00001
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef __MYGUI_PLATFORM_H__
00026 #define __MYGUI_PLATFORM_H__
00027
00028
00029 #define MYGUI_PLATFORM_WIN32 1
00030 #define MYGUI_PLATFORM_LINUX 2
00031 #define MYGUI_PLATFORM_APPLE 3
00032
00033
00034 #define MYGUI_COMPILER_MSVC 1
00035 #define MYGUI_COMPILER_GNUC 2
00036
00037
00038
00039 #if defined (__WIN32__) || defined (_WIN32)
00040 # define MYGUI_PLATFORM MYGUI_PLATFORM_WIN32
00041 #elif defined (__APPLE_CC__)
00042 # define MYGUI_PLATFORM MYGUI_PLATFORM_APPLE
00043 #else
00044 # define MYGUI_PLATFORM MYGUI_PLATFORM_LINUX
00045 #endif
00046
00047
00048 #if defined( _MSC_VER )
00049 # define MYGUI_COMPILER MYGUI_COMPILER_MSVC
00050 # define MYGUI_COMP_VER _MSC_VER
00051
00052 #elif defined( __GNUC__ )
00053 # define MYGUI_COMPILER MYGUI_COMPILER_GNUC
00054 # define MYGUI_COMP_VER (((__GNUC__)*100) + \
00055 (__GNUC_MINOR__*10) + \
00056 __GNUC_PATCHLEVEL__)
00057 #else
00058 # pragma error "Unknown compiler! Stop building!!!"
00059 #endif
00060
00061
00062 #if MYGUI_COMPILER == MYGUI_COMPILER_MSVC
00063 # if MYGUI_COMP_VER >= 1200
00064 # define MYGUI_FORCEINLINE __forceinline
00065 # endif
00066 #elif defined(__MINGW32__)
00067 # if !defined(MYGUI_FORCEINLINE)
00068 # define MYGUI_FORCEINLINE __inline
00069 # endif
00070 #else
00071 # define MYGUI_FORCEINLINE __inline
00072 #endif
00073
00074
00075
00076 #if MYGUI_PLATFORM == MYGUI_PLATFORM_WIN32
00077 #
00078 # if defined( MYGUI_BUILD )
00079 # define MYGUI_EXPORT __declspec( dllexport )
00080 # else
00081 # if defined( __MINGW32__ )
00082 # define MYGUI_EXPORT
00083 # else
00084 # define MYGUI_EXPORT __declspec( dllimport )
00085 # endif
00086 # endif
00087 #
00088 # if defined( MYGUI_BUILD_DLL )
00089 # define MYGUI_EXPORT_DLL __declspec( dllexport )
00090 # else
00091 # if defined( __MINGW32__ )
00092 # define MYGUI_EXPORT_DLL
00093 # else
00094 # define MYGUI_EXPORT_DLL __declspec( dllimport )
00095 # endif
00096 # endif
00097 #
00098 #// Win32 compilers use _DEBUG for specifying debug builds.
00099 # ifdef _DEBUG
00100 # define MYGUI_DEBUG_MODE 1
00101 # else
00102 # define MYGUI_DEBUG_MODE 0
00103 # endif
00104 #endif
00105
00106
00107
00108 #if MYGUI_PLATFORM == MYGUI_PLATFORM_LINUX || MYGUI_PLATFORM == MYGUI_PLATFORM_APPLE
00109
00110
00111
00112
00113 # if __GNUC__ >= 4
00114 # define MYGUI_EXPORT __attribute__ ((visibility("default")))
00115 # else
00116 # define MYGUI_EXPORT
00117 # endif
00118
00119 # if __GNUC__ >= 4
00120 # define MYGUI_EXPORT_DLL __attribute__ ((visibility("default")))
00121 # else
00122 # define MYGUI_EXPORT_DLL
00123 # endif
00124
00125
00126 # define stricmp strcasecmp
00127
00128
00129
00130
00131
00132 # ifdef DEBUG
00133 # define MYGUI_DEBUG_MODE 1
00134 # else
00135 # define MYGUI_DEBUG_MODE 0
00136 # endif
00137
00138 #if MYGUI_PLATFORM == MYGUI_PLATFORM_APPLE
00139 #define MYGUI_PLATFORM_LIB "MYGUIPlatform.bundle"
00140 #else
00141
00142 #define MYGUI_PLATFORM_LIB "libMYGUIPlatform.so"
00143 #endif
00144
00145 #endif
00146
00147
00148 #endif // __MYGUI_PLATFORM_H__