[Rcpp-commits] r386 - pkg/src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Jan 16 16:30:18 CET 2010


Author: romain
Date: 2010-01-16 16:30:18 +0100 (Sat, 16 Jan 2010)
New Revision: 386

Modified:
   pkg/src/RcppCommon.cpp
   pkg/src/RcppCommon.h
Log:
use the __GXX_EXPERIMENTAL_CXX0X__ macro to better shield c++0x features

Modified: pkg/src/RcppCommon.cpp
===================================================================
--- pkg/src/RcppCommon.cpp	2010-01-16 13:13:57 UTC (rev 385)
+++ pkg/src/RcppCommon.cpp	2010-01-16 15:30:18 UTC (rev 386)
@@ -61,8 +61,12 @@
 }
 
 SEXP canUseCXX0X(){
-#ifdef HAS_VARIADIC_TEMPLATES
-	return Rf_ScalarLogical( TRUE ) ;
+#ifdef __GNUC__
+	#ifdef __GXX_EXPERIMENTAL_CXX0X__
+		return Rf_ScalarLogical( TRUE ) ;
+	#else
+		return Rf_ScalarLogical( FALSE ) ;
+	#endif
 #else
 	return Rf_ScalarLogical( FALSE ) ;
 #endif

Modified: pkg/src/RcppCommon.h
===================================================================
--- pkg/src/RcppCommon.h	2010-01-16 13:13:57 UTC (rev 385)
+++ pkg/src/RcppCommon.h	2010-01-16 15:30:18 UTC (rev 386)
@@ -25,13 +25,15 @@
 #define RcppCommon_h
 
 #ifdef __GNUC__
-	#define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
-	#if GCC_VERSION >= 40300
-		#define HAS_VARIADIC_TEMPLATES
+	#ifdef __GXX_EXPERIMENTAL_CXX0X__
+		#define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
+		#if GCC_VERSION >= 40300
+			#define HAS_VARIADIC_TEMPLATES
+		#endif
+		#if GCC_VERSION >= 40400
+			#define HAS_INIT_LISTS
+		#endif
 	#endif
-	#if GCC_VERSION >= 40400
-		#define HAS_INIT_LISTS
-	#endif
 #endif
 
 #include <exception>



More information about the Rcpp-commits mailing list