Fix overloading for non-pointers and NULL - R

This commit is contained in:
William S Fulton 2018-12-30 13:46:51 +00:00
commit f181d20dd1
4 changed files with 66 additions and 25 deletions

View file

@ -3,9 +3,9 @@
%insert("header") "swiglabels.swg"
%insert("header") "swigerrors.swg"
%insert("init") "swiginit.swg"
%insert("runtime") "swigrun.swg"
%insert("runtime") "swigerrors.swg"
%insert("runtime") "rrun.swg"
%init %{

View file

@ -278,7 +278,7 @@ SWIG_R_ConvertPtr(SEXP obj, void **ptr, swig_type_info *ty, int flags) {
if (!obj) return SWIG_ERROR;
if (obj == R_NilValue) {
if (ptr) *ptr = NULL;
return SWIG_OK;
return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK;
}
vptr = R_ExternalPtrAddr(obj);