diff options
| author | maximius <none@none> | 2009-10-17 15:51:44 -0700 |
|---|---|---|
| committer | maximius <none@none> | 2009-10-17 15:51:44 -0700 |
| commit | e585187b248f48b3c6e9247b49fa07c6565d65e5 (patch) | |
| tree | 637c5b7ddacf41040bef4ea4f75a97da64c6a9bc /src/framework/Platform | |
| parent | 26b5e033ffde3d161382fc9addbfa99738379641 (diff) | |
*Backed out changeset 3be01fb200a5
--HG--
branch : trunk
Diffstat (limited to 'src/framework/Platform')
| -rw-r--r-- | src/framework/Platform/CompilerDefs.h | 6 | ||||
| -rw-r--r-- | src/framework/Platform/Define.h | 20 |
2 files changed, 26 insertions, 0 deletions
diff --git a/src/framework/Platform/CompilerDefs.h b/src/framework/Platform/CompilerDefs.h index 863d8bdc2ce..691acb2e6d7 100644 --- a/src/framework/Platform/CompilerDefs.h +++ b/src/framework/Platform/CompilerDefs.h @@ -17,12 +17,15 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + #ifndef TRINITY_COMPILERDEFS_H #define TRINITY_COMPILERDEFS_H + #define PLATFORM_WINDOWS 0 #define PLATFORM_UNIX 1 #define PLATFORM_APPLE 2 #define PLATFORM_INTEL 3 + // must be first (win 64 also define WIN32) #if defined( _WIN64 ) # define PLATFORM PLATFORM_WINDOWS @@ -35,10 +38,12 @@ #else # define PLATFORM PLATFORM_UNIX #endif + #define COMPILER_MICROSOFT 0 #define COMPILER_GNU 1 #define COMPILER_BORLAND 2 #define COMPILER_INTEL 3 + #ifdef _MSC_VER # define COMPILER COMPILER_MICROSOFT #elif defined( __BORLANDC__ ) @@ -50,6 +55,7 @@ #else # pragma error "FATAL ERROR: Unknown compiler." #endif + #if COMPILER == COMPILER_MICROSOFT # pragma warning( disable : 4267 ) // conversion from 'size_t' to 'int', possible loss of data # pragma warning( disable : 4786 ) // identifier was truncated to '255' characters in the debug information diff --git a/src/framework/Platform/Define.h b/src/framework/Platform/Define.h index df4d7deaf7d..d29a53dbf31 100644 --- a/src/framework/Platform/Define.h +++ b/src/framework/Platform/Define.h @@ -17,14 +17,20 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + #ifndef TRINITY_DEFINE_H #define TRINITY_DEFINE_H + #include <sys/types.h> + #include <ace/Basic_Types.h> #include <ace/ACE_export.h> + #include "Platform/CompilerDefs.h" + #define TRINITY_LITTLEENDIAN 0 #define TRINITY_BIGENDIAN 1 + #if !defined(TRINITY_ENDIAN) # if defined (ACE_BIG_ENDIAN) # define TRINITY_ENDIAN TRINITY_BIGENDIAN @@ -32,6 +38,7 @@ # define TRINITY_ENDIAN TRINITY_LITTLEENDIAN # endif //ACE_BYTE_ORDER #endif //TRINITY_ENDIAN + #if PLATFORM == PLATFORM_WINDOWS # define TRINITY_EXPORT __declspec(dllexport) # define TRINITY_LIBRARY_HANDLE HMODULE @@ -72,6 +79,7 @@ # endif //__APPLE_CC__ # define TRINITY_PATH_MAX PATH_MAX #endif //PLATFORM + #if PLATFORM == PLATFORM_WINDOWS # ifdef TRINITY_WIN32_DLL_IMPORT # define TRINITY_DLL_DECL __declspec(dllimport) @@ -85,6 +93,7 @@ #else //PLATFORM != PLATFORM_WINDOWS # define TRINITY_DLL_DECL #endif //PLATFORM + #if PLATFORM == PLATFORM_WINDOWS # define TRINITY_DLL_SPEC __declspec(dllexport) # ifndef DECLSPEC_NORETURN @@ -94,6 +103,7 @@ # define TRINITY_DLL_SPEC # define DECLSPEC_NORETURN #endif //PLATFORM + #if !defined(DEBUG) # define TRINITY_INLINE inline #else //DEBUG @@ -102,6 +112,7 @@ # endif //TRINITY_DEBUG # define TRINITY_INLINE #endif //!DEBUG + #if COMPILER == COMPILER_GNU # define ATTR_NORETURN __attribute__((noreturn)) # define ATTR_PRINTF(F,V) __attribute__ ((format (printf, F, V))) @@ -109,6 +120,7 @@ # define ATTR_NORETURN # define ATTR_PRINTF(F,V) #endif //COMPILER == COMPILER_GNU + typedef ACE_INT64 int64; typedef ACE_INT32 int32; typedef ACE_INT16 int16; @@ -117,15 +129,19 @@ typedef ACE_UINT64 uint64; typedef ACE_UINT32 uint32; typedef ACE_UINT16 uint16; typedef ACE_UINT8 uint8; + #if COMPILER != COMPILER_MICROSOFT typedef uint16 WORD; typedef uint32 DWORD; #endif //COMPILER + typedef uint64 OBJECT_HANDLE; + #define MaNGOS Trinity #define MANGOS_DLL_DECL TRINITY_DLL_DECL #define MANGOS_DLL_SPEC TRINITY_DLL_SPEC #define GetMangosString GetTrinityString + #if defined(MANGOS_DEBUG) || defined(TRINITY_DEBUG) # ifndef TRINITY_DEBUG # define TRINITY_DEBUG @@ -134,15 +150,19 @@ typedef uint64 OBJECT_HANDLE; # define MANGOS_DEBUG # endif #endif + #if !defined(DEBUG) && !defined(MANGOS_DEBUG) && !defined(TRINITY_DEBUG) #define MULTI_THREAD_MAP #endif + #ifdef MULTI_THREAD_MAP #define MAP_BASED_RAND_GEN #endif + #ifndef CLIENT_VER #define CLIENT_VER 313 #endif + #endif //TRINITY_DEFINE_H |
