Skip to content

Commit 370865e

Browse files
authored
Header cleanup (#6993)
* Drop compatibility definitions for R < 3.4 SET_GROWABLE_BIT appeared in 3.4.0, which we now depend upon. R_(Calloc|Realloc|Free) seem to have existed for a long time and definitely were available in 3.4 (per #6380). * Drop R-devel (pre 4.5.0) compatibility definitions During the R-4.5.0 development cycle, R introduced a number of entry points which we were required to use, necessitating checks for SVN revision numbers for compatibility with older versions of R-devel. Since R-4.5.0 has been released, remove the checks. * Rf_isNull -> isNull for <3.5 compatibility
1 parent 50dfeab commit 370865e

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

src/assign.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ SEXP setdt_nrows(SEXP x)
215215
* many operations still work in the presence of NULL columns and it might be convenient
216216
* e.g. in package eplusr which calls setDT on a list when parsing JSON. Operations which
217217
* fail for NULL columns will give helpful error at that point, #3480 and #3471 */
218-
if (Rf_isNull(xi)) continue;
218+
if (isNull(xi)) continue;
219219
if (Rf_inherits(xi, "POSIXlt")) {
220220
error(_("Column %d has class 'POSIXlt'. Please convert it to POSIXct (using as.POSIXct) and run setDT() again. We do not recommend the use of POSIXlt at all because it uses 40 bytes to store one date."), i+1);
221221
}

src/data.table.h

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,8 @@
1212
# define COMPLEX_RO COMPLEX
1313
# define RAW_RO RAW
1414
# define LOGICAL_RO LOGICAL
15-
# define R_Calloc(x, y) Calloc(x, y) // #6380
16-
# define R_Realloc(x, y, z) Realloc(x, y, z)
17-
# define R_Free(x) Free(x)
1815
#endif
19-
#if R_VERSION < R_Version(3, 4, 0)
20-
# define SET_GROWABLE_BIT(x) // #3292
21-
#endif
22-
// TODO: remove the `R_SVN_VERSION` check when R 4.5.0 is released (circa Apr. 2025)
23-
#if R_VERSION < R_Version(4, 5, 0) || R_SVN_REVISION < 86702
16+
#if R_VERSION < R_Version(4, 5, 0)
2417
# define isDataFrame(x) isFrame(x) // #6180
2518
#endif
2619
#include <Rinternals.h>
@@ -44,8 +37,7 @@
4437
/* we mean the encoding bits, not CE_NATIVE in a UTF-8 locale */
4538
#define IS_UTF8(x) (getCharCE(x) == CE_UTF8)
4639
#define IS_LATIN(x) (getCharCE(x) == CE_LATIN1)
47-
// TODO: remove the `R_SVN_VERSION` check when R 4.5.0 is released (circa Apr. 2025)
48-
#if R_VERSION < R_Version(4, 5, 0) || R_SVN_REVISION < 86789
40+
#if R_VERSION < R_Version(4, 5, 0)
4941
# define IS_ASCII(x) (LEVELS(x) & 64)
5042
#else
5143
# define IS_ASCII(x) (Rf_charIsASCII(x)) // no CE_ASCII

0 commit comments

Comments
 (0)