diff options
Diffstat (limited to 'Lib/r/r.swg')
-rw-r--r-- | Lib/r/r.swg | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Lib/r/r.swg b/Lib/r/r.swg index 8cf8cdf53..c1ce37c3e 100644 --- a/Lib/r/r.swg +++ b/Lib/r/r.swg @@ -26,9 +26,13 @@ SWIGEXPORT void SWIG_init(void) { assign(name, _obj); %end_block %enddef -%define %raise(obj,type,desc) -return R_NilValue; -%enddef +%runtime %{ +SWIGINTERN void SWIG_R_Raise(SEXP obj, const char *msg) { + Rf_error(Rf_isString(obj) ? CHAR(Rf_asChar(obj)) : msg); +} +%} + +#define %raise(OBJ, TYPE, DESC) SWIG_R_Raise(OBJ, "C/C++ exception of type " TYPE); return R_NilValue %insert("sinit") "srun.swg" @@ -53,7 +57,7 @@ SWIG_InitializeModule(0); assert(all(sapply($input, class) == "$R_class")); %} -%typemap(out) void ""; +%typemap(out) void "" %typemap(in) int *, int[ANY], signed int *, signed int[ANY], |