File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -38,10 +38,18 @@ __extension__ typedef unsigned long long int rcpp_ulong_long_type;
38
38
#endif
39
39
#endif
40
40
41
- // The Rtools toolchain provides long long on 64bit Windows
42
- #ifdef _WIN64
43
- typedef long long rcpp_long_long_type;
44
- typedef unsigned long long rcpp_ulong_long_type;
41
+ // The Rtools toolchain provides long long on 64bit Windows,
42
+ // but using those types directly in C++98 mode can trigger
43
+ // compiler warnings:
44
+ //
45
+ // warning: ISO C++ 1998 does not support 'long long' [-Wlong-long]
46
+ //
47
+ // fortunately, glibc provides these types as aliases for int64_t
48
+ // and uint64_t, which we can use as extensions in C++98 mode
49
+ #if defined(_WIN32) && defined(_GLIBCXX_HAVE_INT64_T) && defined(_GLIBCXX_HAVE_INT64_T_LONG_LONG)
50
+ # include < stdint.h>
51
+ typedef int64_t rcpp_long_long_type;
52
+ typedef uint64_t rcpp_ulong_long_type;
45
53
#define RCPP_HAS_LONG_LONG_TYPES
46
54
#endif
47
55
You can’t perform that action at this time.
0 commit comments