[Rcpp-devel] [PATCH] Be more liberal in accepting pre-processor defines for 64-bit HAS_LONG_LONG

Dirk Eddelbuettel edd at debian.org
Sun Sep 15 22:33:23 CEST 2013


On 15 September 2013 at 22:08, Simon Zehnder wrote:
| Would possibly something like
| 
| defined(__clang__) && defined(__cplusplus) && (__cplusplus == 201103L)
| defined(__clang__) && defined(__STDC_VERSION__) && (__STDC_VERSION__ == 201112L)
| 
| do? The values given by g++ and clang++ to __cplusplus in C++11 mode match, as well as the values given by gcc and clang to __STDC_VERSION__ in C11 mode.

We settled on requiring clang as well as LP64:

#ifdef __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

Seems to work for g++ and clang++.  

Dirk

-- 
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com


More information about the Rcpp-devel mailing list