OpenMesh

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
compiler.hh
1 /*===========================================================================*\
2 * *
3 * OpenMesh *
4 * Copyright (C) 2001-2014 by Computer Graphics Group, RWTH Aachen *
5 * www.openmesh.org *
6 * *
7 *---------------------------------------------------------------------------*
8 * This file is part of OpenMesh. *
9 * *
10 * OpenMesh is free software: you can redistribute it and/or modify *
11 * it under the terms of the GNU Lesser General Public License as *
12 * published by the Free Software Foundation, either version 3 of *
13 * the License, or (at your option) any later version with the *
14 * following exceptions: *
15 * *
16 * If other files instantiate templates or use macros *
17 * or inline functions from this file, or you compile this file and *
18 * link it with other files to produce an executable, this file does *
19 * not by itself cause the resulting executable to be covered by the *
20 * GNU Lesser General Public License. This exception does not however *
21 * invalidate any other reasons why the executable file might be *
22 * covered by the GNU Lesser General Public License. *
23 * *
24 * OpenMesh is distributed in the hope that it will be useful, *
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
27 * GNU Lesser General Public License for more details. *
28 * *
29 * You should have received a copy of the GNU LesserGeneral Public *
30 * License along with OpenMesh. If not, *
31 * see <http://www.gnu.org/licenses/>. *
32 * *
33 \*===========================================================================*/
34
35 /*===========================================================================*\
36 * *
37 * $Revision: 990 $ *
38 * $Date: 2014-02-05 10:01:07 +0100 (Mi, 05. Feb 2014) $ *
39 * *
40 \*===========================================================================*/
41
42
43 #ifndef OPENMESH_COMPILER_H
44 #define OPENMESH_COMPILER_H
45
46 //=============================================================================
47
48 #if defined(ACGMAKE_STATIC_BUILD)
49 # define OM_STATIC_BUILD 1
50 #endif
51
52 //=============================================================================
53
54 #if defined(_DEBUG) || defined(DEBUG)
55 # define OM_DEBUG
56 #endif
57
58 //=============================================================================
59
60 // Workaround for Intel Compiler with MS VC++ 6
61 #if defined(_MSC_VER) && \
62 ( defined(__ICL) || defined(__INTEL_COMPILER) || defined(__ICC) )
63 # if !defined(__INTEL_COMPILER)
64 # define __INTEL_COMPILER __ICL
65 # endif
66 # define OM_USE_INTEL_COMPILER 1
67 #endif
68
69 // --------------------------------------------------------- MS Visual C++ ----
70 // Compiler _MSC_VER
71 // .NET 2002 1300
72 // .NET 2003 1310
73 // .NET 2005 1400
74 #if defined(_MSC_VER) && !defined(OM_USE_INTEL_COMPILER)
75 # if (_MSC_VER == 1300)
76 # define OM_CC_MSVC
77 # define OM_TYPENAME
78 # define OM_OUT_OF_CLASS_TEMPLATE 0
79 # define OM_PARTIAL_SPECIALIZATION 0
80 # define OM_INCLUDE_TEMPLATES 1
81 # elif (_MSC_VER == 1310)
82 # define OM_CC_MSVC
83 # define OM_TYPENAME
84 # define OM_OUT_OF_CLASS_TEMPLATE 1
85 # define OM_PARTIAL_SPECIALIZATION 1
86 # define OM_INCLUDE_TEMPLATES 1
87 # elif (_MSC_VER >= 1400) // settings for .NET 2005 (NOTE: not fully tested)
88 # define OM_TYPENAME
89 # define OM_OUT_OF_CLASS_TEMPLATE 1
90 # define OM_PARTIAL_SPECIALIZATION 1
91 # define OM_INCLUDE_TEMPLATES 1
92 # else
93 # error "Version 7 (.NET 2002) or higher of the MS VC++ is required!"
94 # endif
95 // currently no windows dll supported
96 # define OM_STATIC_BUILD 1
97 # if defined(_MT)
98 # define OM_REENTRANT 1
99 # endif
100 # define OM_CC "MSVC++"
101 # define OM_CC_VERSION _MSC_VER
102 // Does not work stable because the define _CPPRTTI sometimes does not exist,
103 // though the option /GR is set!?
104 # if defined(__cplusplus) && !defined(_CPPRTTI)
105 # error "Enable Runtime Type Information (Compiler Option /GR)!"
106 # endif
107 # if !defined(_USE_MATH_DEFINES)
108 # error "You have to define _USE_MATH_DEFINES in the compiler settings!"
109 # endif
110 // ------------------------------------------------------------- Borland C ----
111 #elif defined(__BORLANDC__)
112 # error "Borland Compiler are not supported yet!"
113 // ------------------------------------------------------------- GNU C/C++ ----
114 #elif defined(__GNUC__) && !defined(__ICC)
115 # define OM_CC_GCC
116 # define OM_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 )
117 # define OM_GCC_MAJOR __GNUC__
118 # define OM_GCC_MINOR __GNUC_MINOR__
119 # if (OM_GCC_VERSION >= 30200)
120 # define OM_TYPENAME typename
121 # define OM_OUT_OF_CLASS_TEMPLATE 1
122 # define OM_PARTIAL_SPECIALIZATION 1
123 # define OM_INCLUDE_TEMPLATES 1
124 # else
125 # error "Version 3.2.0 or better of the GNU Compiler is required!"
126 # endif
127 # if defined(_REENTRANT)
128 # define OM_REENTRANT 1
129 # endif
130 # define OM_CC "GCC"
131 # define OM_CC_VERSION OM_GCC_VERSION
132 // ------------------------------------------------------------- Intel icc ----
133 #elif defined(__ICC) || defined(__INTEL_COMPILER)
134 # define OM_CC_ICC
135 # define OM_TYPENAME typename
136 # define OM_OUT_OF_CLASS_TEMPLATE 1
137 # define OM_PARTIAL_SPECIALIZATION 1
138 # define OM_INCLUDE_TEMPLATES 1
139 # if defined(_REENTRANT) || defined(_MT)
140 # define OM_REENTRANT 1
141 # endif
142 # define OM_CC "ICC"
143 # define OM_CC_VERSION __INTEL_COMPILER
144 // currently no windows dll supported
145 # if defined(_MSC_VER) || defined(WIN32)
146 # define OM_STATIC_BUILD 1
147 # endif
148 // ------------------------------------------------------ MIPSpro Compiler ----
149 #elif defined(__MIPS_ISA) || defined(__mips)
150 // _MIPS_ISA
151 // _COMPILER_VERSION e.g. 730, 7 major, 3 minor
152 // _MIPS_FPSET 32|64
153 // _MIPS_SZINT 32|64
154 // _MIPS_SZLONG 32|64
155 // _MIPS_SZPTR 32|64
156 # define OM_CC_MIPS
157 # define OM_TYPENAME typename
158 # define OM_OUT_OF_CLASS_TEMPLATE 1
159 # define OM_PARTIAL_SPECIALIZATION 1
160 # define OM_INCLUDE_TEMPLATES 0
161 # define OM_CC "MIPS"
162 # define OM_CC_VERSION _COMPILER_VERSION
163 // ------------------------------------------------------------------ ???? ----
164 #else
165 # error "You're using an unsupported compiler!"
166 #endif
167
168 //=============================================================================
169 #endif // OPENMESH_COMPILER_H defined
170 //=============================================================================
171