Skip to content

Commit 9511768

Browse files
committed
#define RCPP_USING_CXX11 if compiler claims full c++11 support
1 parent 8816c7c commit 9511768

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

inst/include/Rcpp/platform/compiler.h

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@
5858
#endif
5959
#endif
6060

61-
// Check C++0x features
61+
// Check C++0x/11 features
6262
#if defined(__INTEL_COMPILER)
6363
#if __cplusplus >= 201103L
64-
#define HAS_CXX0X_FLAG
64+
#define RCPP_USING_CXX11
6565
#if __INTEL_COMPILER >= 1210
6666
// #define HAS_VARIADIC_TEMPLATES
6767
#endif
@@ -71,7 +71,7 @@
7171
#endif
7272
#elif defined(__clang__)
7373
#if __cplusplus >= 201103L
74-
#define HAS_CXX0X_FLAG
74+
#define RCPP_USING_CXX11
7575
#if __has_feature(cxx_variadic_templates)
7676
// #define HAS_VARIADIC_TEMPLATES
7777
#endif
@@ -81,12 +81,14 @@
8181
#endif
8282
#elif defined(__GNUC__)
8383
#ifdef __GXX_EXPERIMENTAL_CXX0X__
84-
// #define HAS_CXX0X_FLAG
8584
#if GCC_VERSION >= 40300
8685
// #define HAS_VARIADIC_TEMPLATES
8786
#define HAS_STATIC_ASSERT
8887
#endif
8988
#endif
89+
#if GCC_VERSION >= 40800 && __cplusplus >= 201103L
90+
#define RCPP_USING_CXX11
91+
#endif
9092
#endif
9193

9294
// Check C++0x headers
@@ -141,7 +143,7 @@
141143
#include <initializer_list>
142144
#endif
143145

144-
#ifdef HAS_CXX0X_FLAG
146+
#ifdef RCPP_USING_CXX11
145147
#if defined(HAS_CXX0X_UNORDERED_MAP)
146148
#include <unordered_map>
147149
#define RCPP_USING_UNORDERED_MAP
@@ -185,4 +187,5 @@
185187
#define RCPP_HAS_DEMANGLING
186188
#endif
187189

190+
188191
#endif

0 commit comments

Comments
 (0)