Go to the documentation of this file.
22 #ifndef Rcpp__platform__compiler_h
23 #define Rcpp__platform__compiler_h
28 #undef GOOD_COMPILER_FOR_RCPP
30 #define GOOD_COMPILER_FOR_RCPP
33 #define GOOD_COMPILER_FOR_RCPP
36 #define GOOD_COMPILER_FOR_RCPP
38 #ifdef __INTEL_COMPILER
39 #define GOOD_COMPILER_FOR_RCPP
42 #ifndef GOOD_COMPILER_FOR_RCPP
43 # error "This compiler is not supported"
47 #define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
49 #if GCC_VERSION >= 40500
50 #define IS_GCC_450_OR_LATER
53 #if GCC_VERSION < 40600
54 #define IS_EARLIER_THAN_GCC_460
56 #if GCC_VERSION >= 40600
57 #define IS_GCC_460_OR_LATER
62 #if defined(__GXX_EXPERIMENTAL_CXX0X__) || (__cplusplus >= 201103L)
63 #define RCPP_USING_CXX0X_OR_LATER
67 #if defined(__INTEL_COMPILER)
68 #if __cplusplus >= 201103L
69 #define RCPP_USING_CXX11
70 #if __INTEL_COMPILER >= 1210
73 #if __INTEL_COMPILER >= 1100
74 #define HAS_STATIC_ASSERT
77 #elif defined(__clang__)
78 #if __cplusplus >= 201103L
79 #define RCPP_USING_CXX11
80 #if __has_feature(cxx_variadic_templates)
83 #if __has_feature(cxx_static_assert)
84 #define HAS_STATIC_ASSERT
87 #elif defined(__GNUC__)
88 #ifdef __GXX_EXPERIMENTAL_CXX0X__
89 #if GCC_VERSION >= 40300
91 #define HAS_STATIC_ASSERT
94 #if GCC_VERSION >= 40800 && __cplusplus >= 201103L
95 #define RCPP_USING_CXX11
101 #if defined(__INTEL_COMPILER) || (defined(__GNUC__) && !defined(__clang__))
102 #if defined(__GLIBCXX__) && defined(__GXX_EXPERIMENTAL_CXX0X__)
103 #if GCC_VERSION >= 40400
104 #define HAS_CXX0X_UNORDERED_MAP
105 #define HAS_CXX0X_UNORDERED_SET
106 #define HAS_CXX0X_INITIALIZER_LIST
109 #elif defined(__clang__)
110 #if __cplusplus >= 201103L
111 #if __has_include(<unordered_map>)
112 #define HAS_CXX0X_UNORDERED_MAP
114 #if __has_include(<unordered_set>)
115 #define HAS_CXX0X_UNORDERED_SET
117 #if __has_include(<initializer_list>)
118 #define HAS_CXX0X_INITIALIZER_LIST
124 #if defined(__INTEL_COMPILER) || (defined(__GNUC__) && !defined(__clang__))
125 #if defined(__GLIBCXX__)
126 #if GCC_VERSION >= 40400 || ( GCC_VERSION >= 40201 && defined(__APPLE__) )
127 #define HAS_TR1_UNORDERED_MAP
128 #define HAS_TR1_UNORDERED_SET
131 #elif defined(__clang__)
132 #if __cplusplus >= 201103L
133 #if __has_include(<tr1/unordered_map>)
134 #define HAS_TR1_UNORDERED_MAP
136 #if __has_include(<tr1/unordered_set>)
137 #define HAS_TR1_UNORDERED_SET
142 #if defined(HAS_TR1_UNORDERED_MAP) && defined(HAS_TR1_UNORDERED_SET)
147 #ifdef HAS_CXX0X_INITIALIZER_LIST
148 #include <initializer_list>
151 #ifdef RCPP_USING_CXX11
152 #if defined(HAS_CXX0X_UNORDERED_MAP)
153 #include <unordered_map>
154 #define RCPP_USING_UNORDERED_MAP
155 #define RCPP_UNORDERED_MAP std::unordered_map
158 #define RCPP_USING_MAP
159 #define RCPP_UNORDERED_MAP std::map
161 #if defined(HAS_CXX0X_UNORDERED_SET)
162 #include <unordered_set>
163 #define RCPP_USING_UNORDERED_SET
164 #define RCPP_UNORDERED_SET std::unordered_set
167 #define RCPP_USING_SET
168 #define RCPP_UNORDERED_SET std::set
171 #if defined(HAS_TR1_UNORDERED_MAP)
172 #include <tr1/unordered_map>
173 #define RCPP_USING_TR1_UNORDERED_MAP
174 #define RCPP_UNORDERED_MAP std::tr1::unordered_map
177 #define RCPP_USING_MAP
178 #define RCPP_UNORDERED_MAP std::map
180 #if defined(HAS_TR1_UNORDERED_SET)
181 #include <tr1/unordered_set>
182 #define RCPP_USING_TR1_UNORDERED_SET
183 #define RCPP_UNORDERED_SET std::tr1::unordered_set
186 #define RCPP_USING_SET
187 #define RCPP_UNORDERED_SET std::set
192 #define RCPP_HAS_DEMANGLING