[Rcpp-devel] long long
Dirk Eddelbuettel
edd at debian.org
Thu Sep 19 17:39:32 CEST 2013
On 19 September 2013 at 15:48, Romain Francois wrote:
| What I want is to change this:
|
| #if defined(__GNUC__)
| #if defined(__GXX_EXPERIMENTAL_CXX0X__) || (defined (__clang__) &&
| defined(__LP64__))
| #ifdef __LONG_LONG_MAX__
| __extension__ typedef long long int rcpp_long_long_type;
| __extension__ typedef unsigned long long int rcpp_ulong_long_type;
| #define RCPP_HAS_LONG_LONG_TYPES
| #endif
| #endif
| #endif
|
|
| to this:
|
| #if defined(__GNUC__) && defined(__LONG_LONG_MAX__)
| __extension__ typedef long long int rcpp_long_long_type;
| __extension__ typedef unsigned long long int rcpp_ulong_long_type;
| #define RCPP_HAS_LONG_LONG_TYPES
| #endif
That's novel and could work. May need testing. May also need to be checked
against just using -std=c++11 / -std=c++0x which give us long long rightaway.
Also note that Murray got a similar trick into RProtoBuf, albeit at the cost
of configure test (by finding an M4 macros which determines whether the
compiler can in fact do c++11, and if so, turns it on).
| And as long as we don't actually have "long long" in code, but use
| "rcpp_long_long_type" then we are fine :
What happens when you have 'long long' via C++11? Do they coexist?
Also not sure why you first post which seemingly asks for comments and then
still rush to commit before anyone has comments. Oh well.
Dirk
--
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com
More information about the Rcpp-devel
mailing list