summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam S Fulton <wsf@fultondesigns.co.uk>2022-10-24 16:21:29 +0100
committerWilliam S Fulton <wsf@fultondesigns.co.uk>2022-10-24 16:27:54 +0100
commit6370fab025605ccf09e2d14e220a2cb02476427d (patch)
treed02074a2c52d7557803309a72598e07161a321e4
parent1d73341aa424ebcf39caab86defff5ea8f0ee5ac (diff)
downloadswig-6370fab025605ccf09e2d14e220a2cb02476427d.tar.gz
R - fix $typemap() for R specific typemaps
Add support for special variable replacement in the $typemap() special variable macro for R specific typemaps (rtype, rtypecheck, scoercein, scoereout).
-rw-r--r--CHANGES.current5
-rw-r--r--Source/Modules/r.cxx12
2 files changed, 16 insertions, 1 deletions
diff --git a/CHANGES.current b/CHANGES.current
index e5971db72..2ad66dd59 100644
--- a/CHANGES.current
+++ b/CHANGES.current
@@ -8,6 +8,11 @@ Version 4.1.0 (in progress)
===========================
2022-10-24: wsfulton
+ [R] Add support for special variable replacement in the $typemap()
+ special variable macro for R specific typemaps (rtype, rtypecheck,
+ scoercein, scoereout).
+
+2022-10-24: wsfulton
[R] Polymorphism in the wrappers was only working for C++ classes,
now this works for C++ structs too.
diff --git a/Source/Modules/r.cxx b/Source/Modules/r.cxx
index 2256610d5..c51198fed 100644
--- a/Source/Modules/r.cxx
+++ b/Source/Modules/r.cxx
@@ -242,8 +242,8 @@ public:
return status;
}
- // Not used:
String *runtimeCode();
+ void replaceSpecialVariables(String *method, String *tm, Parm *parm);
protected:
int addRegistrationRoutine(String *rname, int nargs);
@@ -2666,6 +2666,16 @@ String * R::runtimeCode() {
return s;
}
+/*----------------------------------------------------------------------
+ * replaceSpecialVariables()
+ *--------------------------------------------------------------------*/
+
+void R::replaceSpecialVariables(String *method, String *tm, Parm *parm) {
+ (void)method;
+ SwigType *type = Getattr(parm, "type");
+ replaceRClass(tm, type);
+}
+
/* -----------------------------------------------------------------------
* Called when SWIG wants to initialize this