[Rcpp-commits] r408 - pkg/inst/discovery

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Jan 19 16:02:05 CET 2010


Author: romain
Date: 2010-01-19 16:02:05 +0100 (Tue, 19 Jan 2010)
New Revision: 408

Modified:
   pkg/inst/discovery/cxx0x.R
Log:
disable c++0x by default

Modified: pkg/inst/discovery/cxx0x.R
===================================================================
--- pkg/inst/discovery/cxx0x.R	2010-01-19 14:06:34 UTC (rev 407)
+++ pkg/inst/discovery/cxx0x.R	2010-01-19 15:02:05 UTC (rev 408)
@@ -21,22 +21,28 @@
 # generate the "-std=c++0x" flag when the compiler in use is GCC >= 4.3
 
 local({
-	cxx0x.code <- '
-	#include <R.h>
-	#include <Rdefines.h>
+	flag <- function(){
 	
-	extern "C" SEXP cxx0x(){
-	
-	#ifdef __GNUC__
-		#define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
-		#if GCC_VERSION >= 40300
-		return mkString( "-std=c++0x" ) ;
+		want.cxx0x <- Sys.getenv( "RCPP_WANT_CXX0X" , unset = "" ) 
+		if( want.cxx0x != "yes" ){
+			return ""
+		}
+		
+		cxx0x.code <- '
+		#include <R.h>
+		#include <Rdefines.h>
+		
+		extern "C" SEXP cxx0x(){
+		
+		#ifdef __GNUC__
+			#define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
+			#if GCC_VERSION >= 40300
+			return mkString( "-std=c++0x" ) ;
+			#endif
 		#endif
-	#endif
-	return mkString( "" ) ;
-	}
-	'
-	flag <- function(){
+		return mkString( "" ) ;
+		}
+		'
 		td <- tempfile()
 		dir.create( td )
 		here <- getwd()



More information about the Rcpp-commits mailing list