[Rd] Patch for RJSONIO

Dirk Eddelbuettel edd @end|ng |rom deb|@n@org
Tue Mar 25 23:53:02 CET 2025


I can never remember where the canonical sources are for the effectively-CRAN
maintained packages so I am dropping it here -- yesterday's update to RJSONIO
does not build on anything older than r-devel.  This patch helps, feel free
to adjust as needed.

Dirk


diff -ru RJSONIO.orig/src/RJSON.c RJSONIO/src/RJSON.c
--- RJSONIO.orig/src/RJSON.c	2025-03-24 02:10:08.000000000 -0500
+++ RJSONIO/src/RJSON.c	2025-03-25 17:49:50.490016649 -0500
@@ -2,6 +2,7 @@
 
 #include <Rinternals.h>
 #include <Rdefines.h>
+#include <Rversion.h>
 
 #include "ConvertUTF.h"
 
@@ -70,7 +71,11 @@
 	    ptr = REAL(tmp);
 	    break;
 	case VECSXP:
+#if R_VERSION >= R_Version(4,5,0)
 	    ptr = (void *) VECTOR_PTR_RO(tmp);
+#else
+	    ptr = (void *) VECTOR_PTR(tmp);
+#endif
 	    break;
 	default:
 	    ptr = NULL;


-- 
dirk.eddelbuettel.com | @eddelbuettel | edd using debian.org



More information about the R-devel mailing list