Octave - SWIG now marshalls a C/C++ NULL pointer into the null matrix, []

SWIG has always marshalled the null matrix into a NULL pointer; this remains
and now we have consistency in representing a NULL pointer.

This is a pre-requisite for a pending commit to fully support std::unique_ptr.
This commit is contained in:
William S Fulton 2022-08-31 07:46:14 +01:00
commit ca9eebcb8d
4 changed files with 27 additions and 5 deletions

View file

@ -1547,12 +1547,15 @@ octave_value_typeinfo::register_binary_op(octave_value::op_##name,tid1,tid2,swig
SWIGRUNTIME octave_value SWIG_Octave_NewPointerObj(void *ptr, swig_type_info *type, int flags) {
int own = (flags &SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0;
if (ptr) {
#ifdef SWIG_DIRECTORS
Swig::Director *d = Swig::get_rtdir(ptr);
if (d && Swig::swig_director_get_self(d))
return Swig::swig_director_get_self(d)->as_value();
Swig::Director *d = Swig::get_rtdir(ptr);
if (d && Swig::swig_director_get_self(d))
return Swig::swig_director_get_self(d)->as_value();
#endif
return Swig::swig_value_ref(new octave_swig_type(ptr, type, own));
return Swig::swig_value_ref(new octave_swig_type(ptr, type, own));
}
return octave_value(Matrix()); // null matrix
}
SWIGRUNTIME int SWIG_Octave_ConvertPtrAndOwn(octave_value ov, void **ptr, swig_type_info *type, int flags, int *own) {