We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a524d14 commit 72cbd17Copy full SHA for 72cbd17
src/data.table.h
@@ -36,7 +36,11 @@
36
/* we mean the encoding bits, not CE_NATIVE in a UTF-8 locale */
37
#define IS_UTF8(x) (getCharCE(x) == CE_UTF8)
38
#define IS_LATIN(x) (getCharCE(x) == CE_LATIN1)
39
-#define IS_ASCII(x) (LEVELS(x) & 64) // API expected in R >= 4.5
+#if R_VERSION < R_Version(4, 5, 0)
40
+# define IS_ASCII(x) (LEVELS(x) & 64)
41
+#else
42
+# define IS_ASCII(x) (Rf_charIsASCII(x)) // no CE_ASCII
43
+#endif
44
#define IS_TRUE(x) (TYPEOF(x)==LGLSXP && LENGTH(x)==1 && LOGICAL(x)[0]==TRUE)
45
#define IS_FALSE(x) (TYPEOF(x)==LGLSXP && LENGTH(x)==1 && LOGICAL(x)[0]==FALSE)
46
#define IS_TRUE_OR_FALSE(x) (TYPEOF(x)==LGLSXP && LENGTH(x)==1 && LOGICAL(x)[0]!=NA_LOGICAL)
0 commit comments