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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Sep 20 02:01:34 CEST 2013


Author: edd
Date: 2013-09-20 02:01:34 +0200 (Fri, 20 Sep 2013)
New Revision: 4524

Modified:
   pkg/Rcpp/ChangeLog
   pkg/Rcpp/inst/NEWS.Rd
   pkg/Rcpp/inst/include/Rcpp/longlong.h
Log:
Unbreak long long by making it (as before) conditional on g++ (or clang) as
well as C++11. The condition can be OR'ed with another suitably-defined
variable, but the default has to be off as CRAN compliance has to remain the
standard.


Modified: pkg/Rcpp/ChangeLog
===================================================================
--- pkg/Rcpp/ChangeLog	2013-09-19 23:02:23 UTC (rev 4523)
+++ pkg/Rcpp/ChangeLog	2013-09-20 00:01:34 UTC (rev 4524)
@@ -1,38 +1,45 @@
-2013-09-20 Romain Francois <romain at r-enthusiasts.com>
+2013-09-19  Dirk Eddelbuettel  <edd at debian.org>
 
+	* inst/include/Rcpp/longlong.h: Unbreak long long by making it (as
+	before) conditional on g++ (or clang) as well as C++11. The condition
+	can be OR'ed with another suitably-defined variable, but the default
+	has to be off as CRAN compliance has to remain the standard
+
+2013-09-19  Romain Francois <romain at r-enthusiasts.com>
+
         * include/Rcpp/longlong.h: isolate all handling of long long
         in a separate file which we might choose not to include by default
 
-2013-09-19 Romain Francois <romain at r-enthusiasts.com>
-
-        * include/Rcpp/traits/r_sexptype_traits.h : unsigned int wrapped as REALSXP
-        long standing feature request from Murray. 
+        * include/Rcpp/traits/r_sexptype_traits.h : unsigned int wrapped as
+	REALSXP long standing feature request from Murray.
         * R/Attributes.R : Added the helper demangle and sizeof functions
         * man/demangle.Rd : Documentation for demangle and sizeof
-        * include/Rcpp/platform/compiler.h : less restritive support of long long 
-        types. But still behind a test for gcc and a test for the availability
-        of the type, and the __extension__. -pedantic does not warn about it
+        * include/Rcpp/platform/compiler.h : less restritive support of long
+	long types. But still behind a test for gcc and a test for the
+	availability of the type, and the __extension__. -pedantic does not
+	warn about it
 
 2013-09-18  JJ Allaire  <jj at rstudio.org>
 
-        * R/Attributes.R: Don't search the inline package as a fallback when loading plugins for the the Rcpp::plugins attribute
+        * R/Attributes.R: Don't search the inline package as a fallback when
+	loading plugins for the the Rcpp::plugins attribute
 
 2013-09-18  Romain Francois <romain at r-enthusiasts.com>
 
-        * vignettes/Rcpp-package.Rnw: Updating the vignette. Setting attributes to TRUE
-        by default. 
-        * R/Rcpp.package.skeleton.R: Setting attributes to TRUE by default. This is
-        what we should encourage people to use. 
+        * vignettes/Rcpp-package.Rnw: Updating the vignette. Setting
+	attributes to TRUE by default.
+        * R/Rcpp.package.skeleton.R: Setting attributes to TRUE by
+	default. This is what we should encourage people to use.
         * include/Rcpp/as.h: add as<char> specialization
-        * include/Rcpp/sugar/functions/diff.h : rework the implementation of diff
-        so that it works even when we don't know the previous value
-        * unitTests/runit.sugar.R : 
+        * include/Rcpp/sugar/functions/diff.h : rework the implementation of
+	diff so that it works even when we don't know the previous value
+        * unitTests/runit.sugar.R :
         * unitTests/cpp/sugar.cpp :
         * include/Rcpp/sugar/functions/range.h : factored out of minmax.h
         * include/Rcpp/sugar/functions/min.h : factored out of minmax.h
         * include/Rcpp/sugar/functions/max.h : factored out of minmax.h
         * TODO : 3 less items
-        
+
 2013-09-17  JJ Allaire  <jj at rstudio.org>
 
 	* R/Attributes.R: Call inlineCxxPlugin and Rcpp.plugin.maker without

Modified: pkg/Rcpp/inst/NEWS.Rd
===================================================================
--- pkg/Rcpp/inst/NEWS.Rd	2013-09-19 23:02:23 UTC (rev 4523)
+++ pkg/Rcpp/inst/NEWS.Rd	2013-09-20 00:01:34 UTC (rev 4524)
@@ -48,7 +48,8 @@
       \code{__LONG_LONG_MAX__} is defined, then we have typedefs 
       \code{rcpp_long_long_type} and \code{rcpp_ulong_long_type} that are defined
       behind a gcc \code{__extension__}. This way, we can create useful 
-      features supporting long long, while having \code{-pedantic} not warn about it. 
+      features supporting long long, while having \code{-pedantic} not
+      warn about it. Note that this still depends on C++11.
     }
     \item Changes in Attributes:
     \itemize{

Modified: pkg/Rcpp/inst/include/Rcpp/longlong.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/longlong.h	2013-09-19 23:02:23 UTC (rev 4523)
+++ pkg/Rcpp/inst/include/Rcpp/longlong.h	2013-09-20 00:01:34 UTC (rev 4524)
@@ -1,4 +1,4 @@
-// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 4 -*-
+// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*-
 //
 // longlong.h: Rcpp R/C++ interface class library -- long long support
 //
@@ -22,6 +22,14 @@
 #ifndef RCPP_LONG_LONG_H
 #define RCPP_LONG_LONG_H
 
+// This does not work as C++98, our default, has no long long support.
+// So we are wrapping another layer of C++11 test around it. Feel free
+// to add a boolean OR with another suitably #define'd variable which
+// has to be OFF by default to restore the old behaviour.
+
+#ifdef __GNUC__
+#if defined(__GXX_EXPERIMENTAL_CXX0X__) || (defined (__clang__) && defined(__LP64__))
+
 // long long and unssigned long long support. 
 //
 // given the current restriction of what might go to CRAN
@@ -71,5 +79,7 @@
 }
 #endif
 
+#endif
+#endif
 
 #endif



More information about the Rcpp-commits mailing list