TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
CompilerDefs.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
3  * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License as published by the
7  * Free Software Foundation; either version 2 of the License, or (at your
8  * option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13  * more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef TRINITY_COMPILERDEFS_H
20 #define TRINITY_COMPILERDEFS_H
21 
22 #define PLATFORM_WINDOWS 0
23 #define PLATFORM_UNIX 1
24 #define PLATFORM_APPLE 2
25 #define PLATFORM_INTEL 3
26 
27 // must be first (win 64 also define _WIN32)
28 #if defined( _WIN64 )
29 # define PLATFORM PLATFORM_WINDOWS
30 #elif defined( __WIN32__ ) || defined( WIN32 ) || defined( _WIN32 )
31 # define PLATFORM PLATFORM_WINDOWS
32 #elif defined( __APPLE_CC__ )
33 # define PLATFORM PLATFORM_APPLE
34 #elif defined( __INTEL_COMPILER )
35 # define PLATFORM PLATFORM_INTEL
36 #else
37 # define PLATFORM PLATFORM_UNIX
38 #endif
39 
40 #define COMPILER_MICROSOFT 0
41 #define COMPILER_GNU 1
42 #define COMPILER_BORLAND 2
43 #define COMPILER_INTEL 3
44 
45 #ifdef _MSC_VER
46 # define COMPILER COMPILER_MICROSOFT
47 #elif defined( __BORLANDC__ )
48 # define COMPILER COMPILER_BORLAND
49 #elif defined( __INTEL_COMPILER )
50 # define COMPILER COMPILER_INTEL
51 #elif defined( __GNUC__ )
52 # define COMPILER COMPILER_GNU
53 # define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
54 #else
55 # error "FATAL ERROR: Unknown compiler."
56 #endif
57 
58 #endif