Skip to content

Commit 6370fab

Browse files
committed
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).
1 parent 1d73341 commit 6370fab

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

CHANGES.current

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ the issue number to the end of the URL: https://github.com/swig/swig/issues/
77
Version 4.1.0 (in progress)
88
===========================
99

10+
2022-10-24: wsfulton
11+
[R] Add support for special variable replacement in the $typemap()
12+
special variable macro for R specific typemaps (rtype, rtypecheck,
13+
scoercein, scoereout).
14+
1015
2022-10-24: wsfulton
1116
[R] Polymorphism in the wrappers was only working for C++ classes,
1217
now this works for C++ structs too.

Source/Modules/r.cxx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,8 @@ class R : public Language {
242242
return status;
243243
}
244244

245-
// Not used:
246245
String *runtimeCode();
246+
void replaceSpecialVariables(String *method, String *tm, Parm *parm);
247247

248248
protected:
249249
int addRegistrationRoutine(String *rname, int nargs);
@@ -2666,6 +2666,16 @@ String * R::runtimeCode() {
26662666
return s;
26672667
}
26682668

2669+
/*----------------------------------------------------------------------
2670+
* replaceSpecialVariables()
2671+
*--------------------------------------------------------------------*/
2672+
2673+
void R::replaceSpecialVariables(String *method, String *tm, Parm *parm) {
2674+
(void)method;
2675+
SwigType *type = Getattr(parm, "type");
2676+
replaceRClass(tm, type);
2677+
}
2678+
26692679

26702680
/* -----------------------------------------------------------------------
26712681
* Called when SWIG wants to initialize this

0 commit comments

Comments
 (0)