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_STATIC )
00079 # define MYGUI_EXPORT
00080 # elif defined( MYGUI_BUILD )
00081 # define MYGUI_EXPORT __declspec( dllexport )
00082 # else
00083 # if defined( __MINGW32__ )
00084 # define MYGUI_EXPORT
00085 # else
00086 # define MYGUI_EXPORT __declspec( dllimport )
00087 # endif
00088 # endif
00089 #
00090 # if defined( MYGUI_STATIC )
00091 # define MYGUI_EXPORT_DLL
00092 # elif defined( MYGUI_BUILD_DLL )
00093 # define MYGUI_EXPORT_DLL __declspec( dllexport )
00094 # else
00095 # if defined( __MINGW32__ )
00096 # define MYGUI_EXPORT_DLL
00097 # else
00098 # define MYGUI_EXPORT_DLL __declspec( dllimport )
00099 # endif
00100 # endif
00101 #
00102 #// Win32 compilers use _DEBUG for specifying debug builds.
00103 # ifdef _DEBUG
00104 # define MYGUI_DEBUG_MODE 1
00105 # else
00106 # define MYGUI_DEBUG_MODE 0
00107 # endif
00108 #endif
00109
00110
00111
00112 #if MYGUI_PLATFORM == MYGUI_PLATFORM_LINUX || MYGUI_PLATFORM == MYGUI_PLATFORM_APPLE
00113 #
00114
00115
00116
00117 # if __GNUC__ >= 4
00118 # define MYGUI_EXPORT __attribute__ ((visibility("default")))
00119 # else
00120 # define MYGUI_EXPORT
00121 # endif
00122 #
00123 # if __GNUC__ >= 4
00124 # define MYGUI_EXPORT_DLL __attribute__ ((visibility("default")))
00125 # else
00126 # define MYGUI_EXPORT_DLL
00127 # endif
00128 #
00129
00130 # define stricmp strcasecmp
00131 #
00132
00133
00134
00135
00136 # ifdef DEBUG
00137 # define MYGUI_DEBUG_MODE 1
00138 # else
00139 # define MYGUI_DEBUG_MODE 0
00140 # endif
00141
00142 # if MYGUI_PLATFORM == MYGUI_PLATFORM_APPLE
00143 # define MYGUI_PLATFORM_LIB "MYGUIPlatform.bundle"
00144 # else // if MYGUI_PLATFORM_LINUX
00145 # define MYGUI_PLATFORM_LIB "libMYGUIPlatform.so"
00146 # endif
00147
00148 #endif
00149
00150
00151 #endif // __MYGUI_PLATFORM_H__