compiler.hh 6.46 KB
Newer Older
Jan Möbius's avatar
Jan Möbius committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
//=============================================================================
//                                                                            
//                               OpenMesh                                     
//        Copyright (C) 2003 by Computer Graphics Group, RWTH Aachen          
//                           www.openmesh.org                                 
//                                                                            
//-----------------------------------------------------------------------------
//                                                                            
//                                License                                     
//                                                                            
//   This library is free software; you can redistribute it and/or modify it 
//   under the terms of the GNU Lesser General Public License as published   
//   by the Free Software Foundation, version 2.1.                           
//                                                                             
//   This library is distributed in the hope that it will be useful, but       
//   WITHOUT ANY WARRANTY; without even the implied warranty of                
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         
//   Lesser General Public License for more details.                           
//                                                                            
//   You should have received a copy of the GNU Lesser General Public          
//   License along with this library; if not, write to the Free Software       
//   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.                 
//                                                                            
//-----------------------------------------------------------------------------
//
Jan Möbius's avatar
Jan Möbius committed
26
27
//   $Revision$
//   $Date$
Jan Möbius's avatar
Jan Möbius committed
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
//
//=============================================================================


#ifndef OPENMESH_COMPILER_H
#define OPENMESH_COMPILER_H

//=============================================================================

#if defined(ACGMAKE_STATIC_BUILD)
#  define OM_STATIC_BUILD 1
#endif

//=============================================================================

#if defined(_DEBUG) || defined(DEBUG)
#  define OM_DEBUG
#endif

//=============================================================================

// Workaround for Intel Compiler with MS VC++ 6
#if defined(_MSC_VER) && \
   ( defined(__ICL) || defined(__INTEL_COMPILER) || defined(__ICC) )
#  if !defined(__INTEL_COMPILER)
#    define __INTEL_COMPILER __ICL
#  endif
#  define OM_USE_INTEL_COMPILER 1
#endif

// --------------------------------------------------------- MS Visual C++ ----
// Compiler _MSC_VER
// .NET 2002 1300 
// .NET 2003 1310
// .NET 2005 1400
#if defined(_MSC_VER) && !defined(OM_USE_INTEL_COMPILER)
#  if (_MSC_VER == 1300)
#    define OM_CC_MSVC
#    define OM_TYPENAME
#    define OM_OUT_OF_CLASS_TEMPLATE       0
#    define OM_PARTIAL_SPECIALIZATION      0
#    define OM_INCLUDE_TEMPLATES           1
#  elif (_MSC_VER == 1310)
#    define OM_CC_MSVC
#    define OM_TYPENAME
#    define OM_OUT_OF_CLASS_TEMPLATE       1
#    define OM_PARTIAL_SPECIALIZATION      1
#    define OM_INCLUDE_TEMPLATES           1
#  elif (_MSC_VER >= 1400) // settings for .NET 2005 (NOTE: not fully tested)
#    pragma warning(disable : 4996)
#    define OM_TYPENAME
#    define OM_OUT_OF_CLASS_TEMPLATE       1
#    define OM_PARTIAL_SPECIALIZATION      1
#    define OM_INCLUDE_TEMPLATES           1
#  else
#    error "Version 7 (.NET 2002) or higher of the MS VC++ is required!"
#  endif
//   currently no windows dll supported
#  define OM_STATIC_BUILD 1
#  if defined(_MT)
#    define OM_REENTRANT 1
#  endif
#  define OM_CC "MSVC++"
#  define OM_CC_VERSION _MSC_VER
// Does not work stable because the define _CPPRTTI sometimes does not exist,
// though the option /GR is set!? 
#  if defined(__cplusplus) && !defined(_CPPRTTI)
#    error "Enable Runtime Type Information (Compiler Option /GR)!"
#  endif
#  if !defined(_USE_MATH_DEFINES)
#    error "You have to define _USE_MATH_DEFINES in the compiler settings!"
#  endif
// ------------------------------------------------------------- Borland C ----
#elif defined(__BORLANDC__)
#  error "Borland Compiler are not supported yet!"
// ------------------------------------------------------------- GNU C/C++ ----
#elif defined(__GNUC__) && !defined(__ICC)
#  define OM_CC_GCC
#  define OM_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 )
#  define OM_GCC_MAJOR                __GNUC__
#  define OM_GCC_MINOR                __GNUC_MINOR__
#  if (OM_GCC_VERSION >= 30200)
#    define OM_TYPENAME typename
#    define OM_OUT_OF_CLASS_TEMPLATE  1
#    define OM_PARTIAL_SPECIALIZATION 1
#    define OM_INCLUDE_TEMPLATES      1
#  else
#    error "Version 3.2.0 or better of the GNU Compiler is required!"
#  endif
#  if defined(_REENTRANT)
#    define OM_REENTRANT 1
#  endif
#  define OM_CC "GCC"
#  define OM_CC_VERSION OM_GCC_VERSION
// ------------------------------------------------------------- Intel icc ----
#elif defined(__ICC) || defined(__INTEL_COMPILER)
#  define OM_CC_ICC
#  define OM_TYPENAME typename
#  define OM_OUT_OF_CLASS_TEMPLATE  1
#  define OM_PARTIAL_SPECIALIZATION 1
#  define OM_INCLUDE_TEMPLATES      1
#  if defined(_REENTRANT) || defined(_MT)
#    define OM_REENTRANT 1
#  endif
#  define OM_CC "ICC"
#  define OM_CC_VERSION __INTEL_COMPILER
//   currently no windows dll supported
#  if defined(_MSC_VER) || defined(WIN32)
#    define OM_STATIC_BUILD 1
#  endif
// ------------------------------------------------------ MIPSpro Compiler ----
#elif defined(__MIPS_ISA) || defined(__mips)
// _MIPS_ISA                    
// _COMPILER_VERSION            e.g. 730, 7 major, 3 minor
// _MIPS_FPSET                  32|64
// _MIPS_SZINT                  32|64
// _MIPS_SZLONG                 32|64
// _MIPS_SZPTR                  32|64
#  define OM_CC_MIPS
#  define OM_TYPENAME typename
#  define OM_OUT_OF_CLASS_TEMPLATE    1
#  define OM_PARTIAL_SPECIALIZATION   1
#  define OM_INCLUDE_TEMPLATES        0
#  define OM_CC "MIPS"
#  define OM_CC_VERSION _COMPILER_VERSION
// ------------------------------------------------------------------ ???? ----
#else
#  error "You're using an unsupported compiler!"
#endif

//=============================================================================
#endif // OPENMESH_COMPILER_H defined
//=============================================================================