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-2012 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: 736 $ *
38 * $Date: 2012-10-08 09:30:49 +0200 (Mo, 08. Okt 2012) $ *
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 # pragma warning(disable : 4996)
89 # define OM_TYPENAME
90 # define OM_OUT_OF_CLASS_TEMPLATE 1
91 # define OM_PARTIAL_SPECIALIZATION 1
92 # define OM_INCLUDE_TEMPLATES 1
93 # else
94 # error "Version 7 (.NET 2002) or higher of the MS VC++ is required!"
95 # endif
96 // currently no windows dll supported
97 # define OM_STATIC_BUILD 1
98 # if defined(_MT)
99 # define OM_REENTRANT 1
100 # endif
101 # define OM_CC "MSVC++"
102 # define OM_CC_VERSION _MSC_VER
103 // Does not work stable because the define _CPPRTTI sometimes does not exist,
104 // though the option /GR is set!?
105 # if defined(__cplusplus) && !defined(_CPPRTTI)
106 # error "Enable Runtime Type Information (Compiler Option /GR)!"
107 # endif
108 # if !defined(_USE_MATH_DEFINES)
109 # error "You have to define _USE_MATH_DEFINES in the compiler settings!"
110 # endif
111 // ------------------------------------------------------------- Borland C ----
112 #elif defined(__BORLANDC__)
113 # error "Borland Compiler are not supported yet!"
114 // ------------------------------------------------------------- GNU C/C++ ----
115 #elif defined(__GNUC__) && !defined(__ICC)
116 # define OM_CC_GCC
117 # define OM_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 )
118 # define OM_GCC_MAJOR __GNUC__
119 # define OM_GCC_MINOR __GNUC_MINOR__
120 # if (OM_GCC_VERSION >= 30200)
121 # define OM_TYPENAME typename
122 # define OM_OUT_OF_CLASS_TEMPLATE 1
123 # define OM_PARTIAL_SPECIALIZATION 1
124 # define OM_INCLUDE_TEMPLATES 1
125 # else
126 # error "Version 3.2.0 or better of the GNU Compiler is required!"
127 # endif
128 # if defined(_REENTRANT)
129 # define OM_REENTRANT 1
130 # endif
131 # define OM_CC "GCC"
132 # define OM_CC_VERSION OM_GCC_VERSION
133 // ------------------------------------------------------------- Intel icc ----
134 #elif defined(__ICC) || defined(__INTEL_COMPILER)
135 # define OM_CC_ICC
136 # define OM_TYPENAME typename
137 # define OM_OUT_OF_CLASS_TEMPLATE 1
138 # define OM_PARTIAL_SPECIALIZATION 1
139 # define OM_INCLUDE_TEMPLATES 1
140 # if defined(_REENTRANT) || defined(_MT)
141 # define OM_REENTRANT 1
142 # endif
143 # define OM_CC "ICC"
144 # define OM_CC_VERSION __INTEL_COMPILER
145 // currently no windows dll supported
146 # if defined(_MSC_VER) || defined(WIN32)
147 # define OM_STATIC_BUILD 1
148 # endif
149 // ------------------------------------------------------ MIPSpro Compiler ----
150 #elif defined(__MIPS_ISA) || defined(__mips)
151 // _MIPS_ISA
152 // _COMPILER_VERSION e.g. 730, 7 major, 3 minor
153 // _MIPS_FPSET 32|64
154 // _MIPS_SZINT 32|64
155 // _MIPS_SZLONG 32|64
156 // _MIPS_SZPTR 32|64
157 # define OM_CC_MIPS
158 # define OM_TYPENAME typename
159 # define OM_OUT_OF_CLASS_TEMPLATE 1
160 # define OM_PARTIAL_SPECIALIZATION 1
161 # define OM_INCLUDE_TEMPLATES 0
162 # define OM_CC "MIPS"
163 # define OM_CC_VERSION _COMPILER_VERSION
164 // ------------------------------------------------------------------ ???? ----
165 #else
166 # error "You're using an unsupported compiler!"
167 #endif
168
169 //=============================================================================
170 #endif // OPENMESH_COMPILER_H defined
171 //=============================================================================
172