Skip to content

Commit fcf959b

Browse files
committed
remove RCPP_HAS_LONG_LONG_TYPES checks
1 parent 88b5f66 commit fcf959b

File tree

5 files changed

+12
-36
lines changed

5 files changed

+12
-36
lines changed

ChangeLog

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,19 @@
1414
* inst/include/Rcpp/utils/tinyformat.h: Idem
1515
* inst/include/Rcpp/longlong.h: Idem, unconditional RCPP_HAS_LONG_LONG_TYPES
1616

17+
* src/api.cpp: Remove explicit RCPP_HAS_LONG_LONG_TYPES as availability is
18+
both implicit and ensured
19+
* inst/include/Rcpp/algorithm.h: Idem
20+
* inst/include/Rcpp/traits/is_arithmetic.h: Idem
21+
* inst/include/Rcpp/traits/longlong.h: Idem
22+
1723
2025-03-21 Dirk Eddelbuettel <[email protected]>
1824

1925
* DESCRIPTION (Version, Date): Roll micro version and date
2026
* inst/include/Rcpp/config.h: Idem
2127

2228
* inst/include/Rcpp/String.h: Remove explicit RCPP_USING_CXX11 as
23-
use of C++11 (or newer) is both implicit and ensuredIdem
29+
use of C++11 (or newer) is both implicit and ensured
2430
* inst/include/Rcpp/macros/dispatch.h: Idem
2531
* inst/include/Rcpp/platform/compiler.h: Idem
2632
* inst/include/Rcpp/unwindProtect.h: Idem

inst/include/Rcpp/algorithm.h

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ namespace helpers {
3131
typedef struct {char a[2];} CTYPE_SHORT;
3232
typedef struct {char a[3];} CTYPE_INT;
3333
typedef struct {char a[4];} CTYPE_LONG;
34-
#ifdef RCPP_HAS_LONG_LONG_TYPES
3534
typedef struct {char a[5];} CTYPE_LONG_LONG;
36-
#endif
3735
typedef struct {char a[6];} CTYPE_FLOAT;
3836
typedef struct {char a[7];} CTYPE_DOUBLE;
3937
typedef struct {char a[8];} CTYPE_LONG_DOUBLE;
@@ -42,9 +40,7 @@ namespace helpers {
4240
typedef struct {char a[11];} CTYPE_UNSIGNED_SHORT;
4341
typedef struct {char a[12];} CTYPE_UNSIGNED_INT;
4442
typedef struct {char a[13];} CTYPE_UNSIGNED_LONG;
45-
#ifdef RCPP_HAS_LONG_LONG_TYPES
4643
typedef struct {char a[14];} CTYPE_UNSIGNED_LONG_LONG;
47-
#endif
4844
typedef struct {char a[128];} CTYPE_UNKNOWN;
4945

5046
template< std::size_t I >
@@ -62,10 +58,8 @@ namespace helpers {
6258
template<>
6359
struct ctype_helper< sizeof(CTYPE_LONG) > { typedef long type; static const bool value = true; };
6460

65-
#ifdef RCPP_HAS_LONG_LONG_TYPES
6661
template<>
6762
struct ctype_helper< sizeof(CTYPE_LONG_LONG) > { typedef rcpp_long_long_type type; static const bool value = true; };
68-
#endif
6963

7064
template<>
7165
struct ctype_helper< sizeof(CTYPE_FLOAT) > { typedef float type; static const bool value = true; };
@@ -91,11 +85,8 @@ namespace helpers {
9185
template<>
9286
struct ctype_helper< sizeof(CTYPE_UNSIGNED_LONG) > { typedef unsigned long type; static const bool value = true; };
9387

94-
#ifdef RCPP_HAS_LONG_LONG_TYPES
9588
template<>
9689
struct ctype_helper< sizeof(CTYPE_UNSIGNED_LONG_LONG) > { typedef rcpp_ulong_long_type type; static const bool value = true; };
97-
#endif
98-
9990

10091
template< typename T >
10192
struct ctype
@@ -104,9 +95,7 @@ namespace helpers {
10495
static CTYPE_SHORT test(const short &);
10596
static CTYPE_INT test(const int &);
10697
static CTYPE_LONG test(const long &);
107-
#ifdef RCPP_HAS_LONG_LONG_TYPES
10898
static CTYPE_LONG_LONG test(const rcpp_long_long_type &);
109-
#endif
11099
static CTYPE_FLOAT test(const float &);
111100
static CTYPE_DOUBLE test(const double &);
112101
static CTYPE_LONG_DOUBLE test(const long double &);
@@ -115,9 +104,7 @@ namespace helpers {
115104
static CTYPE_UNSIGNED_SHORT test(const unsigned short &);
116105
static CTYPE_UNSIGNED_INT test(const unsigned int &);
117106
static CTYPE_UNSIGNED_LONG test(const unsigned long &);
118-
#ifdef RCPP_HAS_LONG_LONG_TYPES
119107
static CTYPE_UNSIGNED_LONG_LONG test(const rcpp_ulong_long_type &);
120-
#endif
121108
static CTYPE_UNKNOWN test(...);
122109

123110
static T make();
@@ -132,9 +119,7 @@ namespace helpers {
132119
static CTYPE_SHORT test(const short &);
133120
static CTYPE_INT test(const int &);
134121
static CTYPE_LONG test(const long &);
135-
#ifdef RCPP_HAS_LONG_LONG_TYPES
136122
static CTYPE_LONG_LONG test(const rcpp_long_long_type &);
137-
#endif
138123
static CTYPE_FLOAT test(const float &);
139124
static CTYPE_DOUBLE test(const double &);
140125
static CTYPE_LONG_DOUBLE test(const long double &);
@@ -143,9 +128,7 @@ namespace helpers {
143128
static CTYPE_UNSIGNED_SHORT test(const unsigned short &);
144129
static CTYPE_UNSIGNED_INT test(const unsigned int &);
145130
static CTYPE_UNSIGNED_LONG test(const unsigned long &);
146-
#ifdef RCPP_HAS_LONG_LONG_TYPES
147131
static CTYPE_UNSIGNED_LONG_LONG test(const rcpp_ulong_long_type &);
148-
#endif
149132
static CTYPE_UNKNOWN test(...);
150133

151134
static T make();

inst/include/Rcpp/traits/is_arithmetic.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//
44
// is_wide_string.h: Rcpp R/C++ interface class library -- traits to help wrap
55
//
6-
// Copyright (C) 2013 Dirk Eddelbuettel and Romain Francois
6+
// Copyright (C) 2013 - 2025 Dirk Eddelbuettel and Romain Francois
77
//
88
// This file is part of Rcpp.
99
//
@@ -58,15 +58,13 @@ namespace traits{
5858

5959
template<>
6060
struct is_arithmetic<const long> : public true_type { };
61-
61+
6262
template<>
6363
struct is_arithmetic<unsigned long> : public true_type { };
6464

6565
template<>
6666
struct is_arithmetic<const unsigned long> : public true_type { };
6767

68-
#if defined(RCPP_HAS_LONG_LONG_TYPES)
69-
7068
template<>
7169
struct is_arithmetic<rcpp_long_long_type> : public true_type { };
7270

@@ -79,8 +77,6 @@ namespace traits{
7977
template<>
8078
struct is_arithmetic<const rcpp_ulong_long_type> : public true_type { };
8179

82-
#endif
83-
8480
template<>
8581
struct is_arithmetic<float> : public true_type { };
8682

inst/include/Rcpp/traits/longlong.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// longlong.h: Rcpp R/C++ interface class library -- long long traits
44
//
5-
// Copyright (C) 2013 Dirk Eddelbuettel and Romain Francois
5+
// Copyright (C) 2013 - 2025 Dirk Eddelbuettel and Romain Francois
66
//
77
// This file is part of Rcpp.
88
//
@@ -22,8 +22,6 @@
2222
#ifndef RCPP_TRAITS_LONG_LONG_H
2323
#define RCPP_TRAITS_LONG_LONG_H
2424

25-
#if defined(RCPP_HAS_LONG_LONG_TYPES)
26-
2725
namespace Rcpp{
2826
namespace traits{
2927

@@ -39,6 +37,5 @@ namespace Rcpp{
3937
template <> struct wrap_type_traits<rcpp_ulong_long_type> { typedef wrap_type_primitive_tag wrap_category; } ;
4038
}
4139
}
42-
#endif
4340

4441
#endif

src/api.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// api.cpp: Rcpp R/C++ interface class library -- Rcpp api
44
//
55
// Copyright (C) 2012 - 2020 Dirk Eddelbuettel and Romain Francois
6-
// Copyright (C) 2021 - 2023 Dirk Eddelbuettel, Romain Francois and Iñaki Ucar
6+
// Copyright (C) 2021 - 2025 Dirk Eddelbuettel, Romain Francois and Iñaki Ucar
77
//
88
// This file is part of Rcpp.
99
//
@@ -185,13 +185,7 @@ SEXP rcpp_capabilities() {
185185
#endif
186186

187187
LOGICAL(cap)[7] = FALSE; // Classic API
188-
189-
#ifdef RCPP_HAS_LONG_LONG_TYPES
190-
LOGICAL(cap)[8] = TRUE;
191-
#else
192-
LOGICAL(cap)[8] = FALSE;
193-
#endif
194-
188+
LOGICAL(cap)[8] = TRUE; // RCPP_HAS_LONG_LONG_TYPES
195189
LOGICAL(cap)[9] = TRUE; // HAS_CXX0X_UNORDERED_MAP
196190
LOGICAL(cap)[10] = TRUE; // HAS_CXX0X_UNORDERED_SET
197191
LOGICAL(cap)[11] = TRUE; // RCPP_USING_CXX11

0 commit comments

Comments
 (0)