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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue May 11 15:37:09 CEST 2010


Author: romain
Date: 2010-05-11 15:37:09 +0200 (Tue, 11 May 2010)
New Revision: 1196

Modified:
   pkg/Rcpp/inst/ChangeLog
   pkg/Rcpp/inst/include/Rcpp/traits/r_sexptype_traits.h
   pkg/Rcpp/inst/include/Rcpp/traits/r_type_traits.h
   pkg/Rcpp/inst/include/Rcpp/traits/wrap_type_traits.h
   pkg/Rcpp/inst/include/RcppCommon.h
Log:
adding support for (unsigned) long long int types (needed in win64)

Modified: pkg/Rcpp/inst/ChangeLog
===================================================================
--- pkg/Rcpp/inst/ChangeLog	2010-05-10 15:21:45 UTC (rev 1195)
+++ pkg/Rcpp/inst/ChangeLog	2010-05-11 13:37:09 UTC (rev 1196)
@@ -1,3 +1,8 @@
+2010-05-11  Romain Francois <romain at r-enthusiasts.com>
+
+	* inst/include/Rcpp/traits/*.h: added support for long long int and 
+	unsigned long long int, which is size_t on win64
+
 2010-05-10  Romain Francois <romain at r-enthusiasts.com>
 
 	* inst/include/Rcpp/Dimension.h: added a const operator[], requested

Modified: pkg/Rcpp/inst/include/Rcpp/traits/r_sexptype_traits.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/traits/r_sexptype_traits.h	2010-05-10 15:21:45 UTC (rev 1195)
+++ pkg/Rcpp/inst/include/Rcpp/traits/r_sexptype_traits.h	2010-05-11 13:37:09 UTC (rev 1196)
@@ -56,7 +56,16 @@
 template<> struct r_sexptype_traits<short>{ enum{ rtype = INTSXP } ; } ;
 template<> struct r_sexptype_traits<unsigned short>{ enum{ rtype = INTSXP } ; } ;
 
+/* long long int */
+#ifdef LONG_LONG_MAX
+template<> struct r_sexptype_traits<long long int>{ enum{ rtype = REALSXP } ; } ;
+#endif
 
+/* unsigned long long int */
+#ifdef ULONG_LONG_MAX
+template<> struct r_sexptype_traits<unsigned long long int>{ enum{ rtype = REALSXP } ; } ;
+#endif
+
 /**
  * Indicates if a primitive type needs a static_cast
  */
@@ -66,6 +75,7 @@
 template<> struct r_sexptype_needscast<Rcomplex>     : public false_type{} ;
 template<> struct r_sexptype_needscast<Rbyte>        : public false_type{} ;
 
+
 } // traits
 } // Rcpp
 

Modified: pkg/Rcpp/inst/include/Rcpp/traits/r_type_traits.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/traits/r_type_traits.h	2010-05-10 15:21:45 UTC (rev 1195)
+++ pkg/Rcpp/inst/include/Rcpp/traits/r_type_traits.h	2010-05-11 13:37:09 UTC (rev 1196)
@@ -107,10 +107,23 @@
 template<> struct r_type_traits<short>{ typedef r_type_primitive_tag r_category ; } ;
 template<> struct r_type_traits< std::pair<const std::string,short> >{ typedef r_type_primitive_tag r_category ; } ;
 
-/* short */
+/* unsigned short */
 template<> struct r_type_traits<unsigned short>{ typedef r_type_primitive_tag r_category ; } ;
 template<> struct r_type_traits< std::pair<const std::string,unsigned short> >{ typedef r_type_primitive_tag r_category ; } ;
 
+/* long long int */
+#ifdef LONG_LONG_MAX
+template<> struct r_type_traits<long long int>{ typedef r_type_primitive_tag r_category ; } ;
+template<> struct r_type_traits< std::pair<const std::string,long long int> >{ typedef r_type_primitive_tag r_category ; } ;
+#endif
+
+/* unsigned long long int */
+#ifdef ULONG_LONG_MAX
+template<> struct r_type_traits<unsigned long long int>{ typedef r_type_primitive_tag r_category ; } ;
+template<> struct r_type_traits< std::pair<const std::string,unsigned long long int> >{ typedef r_type_primitive_tag r_category ; } ;
+#endif
+
+
 } // traits
 } // Rcpp
 

Modified: pkg/Rcpp/inst/include/Rcpp/traits/wrap_type_traits.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/traits/wrap_type_traits.h	2010-05-10 15:21:45 UTC (rev 1195)
+++ pkg/Rcpp/inst/include/Rcpp/traits/wrap_type_traits.h	2010-05-11 13:37:09 UTC (rev 1196)
@@ -71,6 +71,14 @@
 template <> struct wrap_type_traits<short> { typedef wrap_type_primitive_tag wrap_category; } ;
 template <> struct wrap_type_traits<unsigned short> { typedef wrap_type_primitive_tag wrap_category; } ;
 
+#ifdef LONG_LONG_MAX
+template <> struct wrap_type_traits<long long int> { typedef wrap_type_primitive_tag wrap_category; } ;
+#endif
+
+#ifdef ULONG_LONG_MAX
+template <> struct wrap_type_traits<unsigned long long int> { typedef wrap_type_primitive_tag wrap_category; } ;
+#endif 
+
 } // namespace traits
 } // namespace Rcpp
 #endif

Modified: pkg/Rcpp/inst/include/RcppCommon.h
===================================================================
--- pkg/Rcpp/inst/include/RcppCommon.h	2010-05-10 15:21:45 UTC (rev 1195)
+++ pkg/Rcpp/inst/include/RcppCommon.h	2010-05-11 13:37:09 UTC (rev 1196)
@@ -77,6 +77,7 @@
 #include <numeric>
 #include <algorithm>
 #include <complex>
+#include <limits.h>
 
 #ifdef HAS_INIT_LISTS
 #include <initializer_list>



More information about the Rcpp-commits mailing list