Skip to content

Commit 9bee4f3

Browse files
committed
remove over-aggressive check; bring back c++0x logic
1 parent f9d05e6 commit 9bee4f3

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

inst/include/Rcpp/longlong.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,22 @@ typedef unsigned long long int rcpp_ulong_long_type;
3333
// (note that __GNUC__ also implies clang, MinGW)
3434
#elif defined(__GNUC__)
3535

36-
// check to see if 'long long' can be used as an extension
37-
# if defined(_GLIBCXX_USE_LONG_LONG)
38-
39-
__extension__ typedef long long int rcpp_long_long_type;
40-
__extension__ typedef unsigned long long int rcpp_ulong_long_type;
41-
# define RCPP_HAS_LONG_LONG_TYPES
42-
4336
// check to see if 'long long' is an alias for 'int64_t'
44-
# elif defined(_GLIBCXX_HAVE_INT64_T) && defined(_GLIBCXX_HAVE_INT64_T_LONG_LONG)
37+
# if defined(_GLIBCXX_HAVE_INT64_T) && defined(_GLIBCXX_HAVE_INT64_T_LONG_LONG)
4538
# include <stdint.h>
4639
typedef int64_t rcpp_long_long_type;
4740
typedef uint64_t rcpp_ulong_long_type;
4841
# define RCPP_HAS_LONG_LONG_TYPES
4942

43+
// check to see if this is an older C++ compiler, but extensions are enabled
44+
# elif defined(__GXX_EXPERIMENTAL_CXX0X__) || (defined(__clang__) && defined(__LP64__))
45+
# if defined(__LONG_LONG_MAX__)
46+
typedef long long int rcpp_long_long_type;
47+
typedef unsigned long long int rcpp_ulong_long_type;
48+
# define RCPP_HAS_LONG_LONG_TYPES
49+
# endif
5050
# endif
51-
#endif
5251

52+
#endif
5353

5454
#endif

0 commit comments

Comments
 (0)