diff --git a/.Rbuildignore b/.Rbuildignore index 73609e8..30b9100 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -34,3 +34,4 @@ dparser.*\.(zip|pdf)$ ^_pkgdown\.yml$ ^docs$ ^pkgdown$ +^revdep$ diff --git a/.gitignore b/.gitignore index 00efe07..b8deac0 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ inst/doc /src/dparser/.* *.so docs +revdep/ diff --git a/CRAN-SUBMISSION b/CRAN-SUBMISSION index 11263e0..e212d36 100644 --- a/CRAN-SUBMISSION +++ b/CRAN-SUBMISSION @@ -1,3 +1,3 @@ -Version: 1.3.1-12 -Date: 2024-09-17 21:41:28 UTC -SHA: 02f72d4ec4bef5c2fb321730e07cfc1ae372231b +Version: 1.3.1-13 +Date: 2024-10-22 18:41:22 UTC +SHA: dc90eb4f4927f916970d2e282e79f55e725e823d diff --git a/NEWS.md b/NEWS.md index 0962ee8..0b28bbb 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,7 +1,7 @@ # dparser 1.3.1-13 -- R version specific code for calling R within C to match version - specific requirements (#19) +- Changed `Makevars` header order, strict options so that `dparser` + will compile on older versions of R (#19, #20, #22) # dparser 1.3.1-12 diff --git a/cran-comments.md b/cran-comments.md index 936adba..f40cf76 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,7 +1,3 @@ # dparser -- This fixes the `Strict` issues flagged by CRAN. - -- This also adds a non-abi interface to dparser from C. This means - this can be updated without updating all of the - 'rxode2'/'nlmixr2est' ecosystem in the future. +- This fix allows older version of `R` to compile diff --git a/src/Makevars b/src/Makevars index 0c58b58..639fb27 100644 --- a/src/Makevars +++ b/src/Makevars @@ -1,3 +1 @@ -PKG_CFLAGS = -DUSE_FREELISTS -DTRACK_PNODES -DSTRICT_R_HEADERS=1 -SOURCES_C = parse.c scan.c dsymtab.c util.c mkdparse.c write_tables.c grammar.g.c gram.c lex.c lr.c version.c read_binary.c dparser.c mkdparser.c rdparse.c -OBJECTS = $(SOURCES_C:.c=.o) +PKG_CFLAGS = -DUSE_FREELISTS -DTRACK_PNODES diff --git a/src/rdparse.c b/src/rdparse.c index 41aa0aa..21a1382 100644 --- a/src/rdparse.c +++ b/src/rdparse.c @@ -1,12 +1,11 @@ -#include "gramgram.h" -#include "d.h" -#include "mkdparse.h" -#include "dparse.h" -#define R_NO_REMAP #include #include #include #include +#include "gramgram.h" +#include "d.h" +#include "mkdparse.h" +#include "dparse.h" extern int d_use_file_name; extern char *d_file_name; extern int d_use_r_headers; @@ -27,12 +26,7 @@ void callparsefn(char *name, char *value, int pos, int depth, SEXP fn, SEXP env) fn(name = name, value = value, pos = pos, depth = depth) */ SEXP s, t; -#if R_MAJOR > 4 || (R_MAJOR == 4 && R_MINOR >= 4) t = s = PROTECT(LCONS(R_NilValue, Rf_allocList(4))); -#else - t = s = PROTECT(Rf_allocList(5)); - SET_TYPEOF(s, LANGSXP); -#endif SETCAR(t, fn); t = CDR(t); // name = name SETCAR(t, Rf_mkString(name)); @@ -57,12 +51,7 @@ int callskipchildrenfn(char *name, char *value, int pos, int depth, SEXP skip_fn */ SEXP s, t; int ret; -#if R_MAJOR > 4 || (R_MAJOR == 4 && R_MINOR >= 4) t = s = PROTECT(LCONS(R_NilValue, Rf_allocList(4))); -#else - t = s = PROTECT(Rf_allocList(5)); - SET_TYPEOF(s, LANGSXP); -#endif SETCAR(t, skip_fn); t = CDR(t); // name = name SETCAR(t, Rf_mkString(name));