[Rcpp-commits] r4054 - in pkg/Rcpp: . inst inst/include

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Dec 1 15:07:19 CET 2012


Author: edd
Date: 2012-12-01 15:07:19 +0100 (Sat, 01 Dec 2012)
New Revision: 4054

Modified:
   pkg/Rcpp/ChangeLog
   pkg/Rcpp/inst/NEWS.Rd
   pkg/Rcpp/inst/THANKS
   pkg/Rcpp/inst/include/RcppCommon.h
Log:
patch by Yan Zhou


Modified: pkg/Rcpp/ChangeLog
===================================================================
--- pkg/Rcpp/ChangeLog	2012-11-29 18:01:09 UTC (rev 4053)
+++ pkg/Rcpp/ChangeLog	2012-12-01 14:07:19 UTC (rev 4054)
@@ -1,3 +1,8 @@
+2012-12-01  Dirk Eddelbuettel  <edd at debian.org>
+
+	* inst/include/RcppCommon.h: Applied patch by Yan Zhou to add support
+	for clang++ with libc++, and Intel's icpc when std=c++11
+
 2012-11-29 Romain Francois <romain at r-enthusiasts.com>
 
         * unitTests/runit.DataFrame.R: using sourceCpp

Modified: pkg/Rcpp/inst/NEWS.Rd
===================================================================
--- pkg/Rcpp/inst/NEWS.Rd	2012-11-29 18:01:09 UTC (rev 4053)
+++ pkg/Rcpp/inst/NEWS.Rd	2012-12-01 14:07:19 UTC (rev 4054)
@@ -6,7 +6,10 @@
   \itemize{
     \item Changes in Rcpp API:
     \itemize{
-      \item Added additional check in Rstreambuf deletetion
+      \item Added additional check in \code{Rstreambuf} deletetion
+      \item Added support for \code{clang++} when using \code{libc++},
+      and for anc \code{icpc} in \code{std=c++11} mode, thanks to a
+      patch by Yan Zhou 
     }
   }
 }

Modified: pkg/Rcpp/inst/THANKS
===================================================================
--- pkg/Rcpp/inst/THANKS	2012-11-29 18:01:09 UTC (rev 4053)
+++ pkg/Rcpp/inst/THANKS	2012-12-01 14:07:19 UTC (rev 4054)
@@ -24,3 +24,4 @@
 Simon Urbanek           for help on OS X build issues and with R internals
 Ken Williams            for additional OS X testing
 Jelmer Ypma             for contributing the Rcout iostreams class patch
+Yan Zhou		for a patch to RcppCommon.h extending compiler support 

Modified: pkg/Rcpp/inst/include/RcppCommon.h
===================================================================
--- pkg/Rcpp/inst/include/RcppCommon.h	2012-11-29 18:01:09 UTC (rev 4053)
+++ pkg/Rcpp/inst/include/RcppCommon.h	2012-12-01 14:07:19 UTC (rev 4054)
@@ -107,14 +107,33 @@
 //     #endif
 // #endif
 
+// This definition was contributed by Yan Zhou
+#ifdef __clang__
+    #if !__has_include(<tr1/unordered_map>)
+        #undef HAS_TR1
+        #undef HAS_TR1_UNORDERED_MAP
+    #endif
+    #if !__has_include(<tr1/unordered_set>)
+        #undef HAS_TR1
+        #undef HAS_TR1_UNORDERED_SET
+    #endif
+    #if __has_feature(cxx_variadic_templates)
+        #define HAS_VARIADIC_TEMPLATES
+    #endif
+#endif
+
 #ifdef __INTEL_COMPILER
     // This is based on an email by Alexey Stukalov who tested 
     // Intel Compiler 12.0 and states that is does support Cxx0x 
     // or even TR1 (by default; maybe there are options?)
+    // Extended further via patch in email by Yan Zhou
     #undef HAS_VARIADIC_TEMPLATES
+    #include <cmath>
+    #ifndef __GLIBCXX__
     #undef HAS_TR1
     #undef HAS_TR1_UNORDERED_MAP
     #undef HAS_TR1_UNORDERED_SET
+    #endif
 #endif
 
 
@@ -149,6 +168,21 @@
 #include <tr1/unordered_set>
 #endif
 
+
+#if __cplusplus >= 201103L
+    #if defined(__GLIBCXX__) && __GLIBCXX__ > 20090421
+    #include <unordered_map>
+    #include <unordered_set>
+    #elif defined(__clang__)
+        #if __has_include(<unordered_map>)
+        #include <unordered_map>
+        #endif
+        #if __has_include(<unordered_set>)
+        #include <unordered_set>
+        #endif
+    #endif
+#endif
+
 std::string demangle( const std::string& name) ;
 #define DEMANGLE(__TYPE__) demangle( typeid(__TYPE__).name() ).c_str() 
 



More information about the Rcpp-commits mailing list