From 4cf85730be261cde76768a60d9ca1a8b5b609b39 Mon Sep 17 00:00:00 2001 From: Matthew Fidler Date: Tue, 22 Oct 2024 12:33:57 -0500 Subject: [PATCH 1/9] Tak out incompatible info --- src/rdparse.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/rdparse.c b/src/rdparse.c index 41aa0aa..8c35f19 100644 --- a/src/rdparse.c +++ b/src/rdparse.c @@ -2,7 +2,6 @@ #include "d.h" #include "mkdparse.h" #include "dparse.h" -#define R_NO_REMAP #include #include #include @@ -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)); From 18a9cbfaccdaffd578876cf0d0b875d0db27ad39 Mon Sep 17 00:00:00 2001 From: Matthew Fidler Date: Tue, 22 Oct 2024 12:38:31 -0500 Subject: [PATCH 2/9] Remove strict headers --- src/Makevars | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makevars b/src/Makevars index 0c58b58..eaee8a6 100644 --- a/src/Makevars +++ b/src/Makevars @@ -1,3 +1,3 @@ -PKG_CFLAGS = -DUSE_FREELISTS -DTRACK_PNODES -DSTRICT_R_HEADERS=1 +PKG_CFLAGS = -DUSE_FREELISTS -DTRACK_PNODES 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) From 2a66971bc3bbf4daf7c0977cc673941b98a0fbef Mon Sep 17 00:00:00 2001 From: Matthew Fidler Date: Tue, 22 Oct 2024 12:42:15 -0500 Subject: [PATCH 3/9] Revert "Remove strict headers" This reverts commit 18a9cbfaccdaffd578876cf0d0b875d0db27ad39. --- src/Makevars | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makevars b/src/Makevars index eaee8a6..0c58b58 100644 --- a/src/Makevars +++ b/src/Makevars @@ -1,3 +1,3 @@ -PKG_CFLAGS = -DUSE_FREELISTS -DTRACK_PNODES +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) From ae21c1f21a926123f7507662f9b895f913637ec0 Mon Sep 17 00:00:00 2001 From: Matthew Fidler Date: Tue, 22 Oct 2024 12:58:47 -0500 Subject: [PATCH 4/9] Another attempt to get around SET_TYPEOF for old/new R --- src/Makevars | 2 +- src/rdparse.c | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Makevars b/src/Makevars index 0c58b58..53c1198 100644 --- a/src/Makevars +++ b/src/Makevars @@ -1,3 +1,3 @@ -PKG_CFLAGS = -DUSE_FREELISTS -DTRACK_PNODES -DSTRICT_R_HEADERS=1 +PKG_CFLAGS = -DUSE_FREELISTS -DTRACK_PNODES -DSTRICT_R_HEADERS=1 -Dsto=SET_TYPEOF 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) diff --git a/src/rdparse.c b/src/rdparse.c index 8c35f19..f3fec7d 100644 --- a/src/rdparse.c +++ b/src/rdparse.c @@ -2,6 +2,7 @@ #include "d.h" #include "mkdparse.h" #include "dparse.h" +#define R_NO_REMAP #include #include #include @@ -26,7 +27,12 @@ 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)); + sto(s, LANGSXP); +#endif SETCAR(t, fn); t = CDR(t); // name = name SETCAR(t, Rf_mkString(name)); @@ -51,7 +57,12 @@ 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)); + sto(s, LANGSXP); +#endif SETCAR(t, skip_fn); t = CDR(t); // name = name SETCAR(t, Rf_mkString(name)); From 41cc79359e3e8202a484fb196959d881025bdb79 Mon Sep 17 00:00:00 2001 From: Matthew Fidler Date: Tue, 22 Oct 2024 13:14:02 -0500 Subject: [PATCH 5/9] Change strict r headers options --- src/Makevars | 2 +- src/rdparse.c | 19 ++++--------------- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/src/Makevars b/src/Makevars index 53c1198..eaee8a6 100644 --- a/src/Makevars +++ b/src/Makevars @@ -1,3 +1,3 @@ -PKG_CFLAGS = -DUSE_FREELISTS -DTRACK_PNODES -DSTRICT_R_HEADERS=1 -Dsto=SET_TYPEOF +PKG_CFLAGS = -DUSE_FREELISTS -DTRACK_PNODES 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) diff --git a/src/rdparse.c b/src/rdparse.c index f3fec7d..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)); - sto(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)); - sto(s, LANGSXP); -#endif SETCAR(t, skip_fn); t = CDR(t); // name = name SETCAR(t, Rf_mkString(name)); From aad49ea6642d9fc7f68052e80dcf491703cfbe69 Mon Sep 17 00:00:00 2001 From: Matthew Fidler Date: Tue, 22 Oct 2024 13:15:04 -0500 Subject: [PATCH 6/9] Remove sources and only have pkg_cflags --- src/Makevars | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Makevars b/src/Makevars index eaee8a6..639fb27 100644 --- a/src/Makevars +++ b/src/Makevars @@ -1,3 +1 @@ PKG_CFLAGS = -DUSE_FREELISTS -DTRACK_PNODES -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) From 90944498161060e33209abc0a2e671c7a76d6af2 Mon Sep 17 00:00:00 2001 From: Matthew Fidler Date: Tue, 22 Oct 2024 13:18:07 -0500 Subject: [PATCH 7/9] Fix LCONS so that it will work with dparser --- NEWS.md | 4 ++-- cran-comments.md | 6 +----- 2 files changed, 3 insertions(+), 7 deletions(-) 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 From dc90eb4f4927f916970d2e282e79f55e725e823d Mon Sep 17 00:00:00 2001 From: Matthew Fidler Date: Tue, 22 Oct 2024 13:28:33 -0500 Subject: [PATCH 8/9] Add revdep ignore --- .Rbuildignore | 1 + .gitignore | 1 + 2 files changed, 2 insertions(+) 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/ From 2346113e752c3e1017544a018c29f5cab91ef6f0 Mon Sep 17 00:00:00 2001 From: Matthew Fidler Date: Tue, 22 Oct 2024 17:12:07 -0500 Subject: [PATCH 9/9] Add cran submission --- CRAN-SUBMISSION | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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