Add missing typecheck typemaps for std::auto_ptr and std::unique_ptr

To fix overloading when using these types.
This commit is contained in:
William S Fulton 2022-09-17 10:23:51 +01:00
commit e97181ebc0
59 changed files with 442 additions and 2 deletions

View file

@ -28,6 +28,8 @@
return ret;
}
%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *") std::auto_ptr< TYPE > ""
%template() std::auto_ptr< TYPE >;
%enddef

View file

@ -28,6 +28,8 @@
return ret;
}
%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *") std::unique_ptr< TYPE > ""
%template() std::unique_ptr< TYPE >;
%enddef

View file

@ -32,6 +32,8 @@
return ret;
}
%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *") std::auto_ptr< TYPE > ""
%template() std::auto_ptr< TYPE >;
%enddef

View file

@ -32,6 +32,8 @@
return ret;
}
%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *") std::unique_ptr< TYPE > ""
%template() std::unique_ptr< TYPE >;
%enddef

View file

@ -25,6 +25,12 @@
%set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN));
%}
%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > {
void *vptr = 0;
int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0);
$1 = SWIG_CheckState(res);
}
%template() std::auto_ptr< TYPE >;
%enddef

View file

@ -25,6 +25,12 @@
%set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN));
%}
%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > {
void *vptr = 0;
int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0);
$1 = SWIG_CheckState(res);
}
%template() std::unique_ptr< TYPE >;
%enddef

View file

@ -31,6 +31,8 @@
return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true);
}
%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *") std::auto_ptr< TYPE > ""
%template() std::auto_ptr< TYPE >;
%enddef

View file

@ -31,6 +31,8 @@
return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true);
}
%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *") std::unique_ptr< TYPE > ""
%template() std::unique_ptr< TYPE >;
%enddef

View file

@ -25,6 +25,12 @@
%set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags));
%}
%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > {
void *vptr = 0;
int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0);
$1 = SWIG_CheckState(res);
}
%template() std::auto_ptr< TYPE >;
%enddef

View file

@ -25,6 +25,12 @@
%set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags));
%}
%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > {
void *vptr = 0;
int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0);
$1 = SWIG_CheckState(res);
}
%template() std::unique_ptr< TYPE >;
%enddef

View file

@ -25,6 +25,12 @@
%set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags));
%}
%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > {
void *vptr = 0;
int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0);
$1 = SWIG_CheckState(res);
}
%template() std::auto_ptr< TYPE >;
%enddef

View file

@ -25,6 +25,12 @@
%set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags));
%}
%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > {
void *vptr = 0;
int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0);
$1 = SWIG_CheckState(res);
}
%template() std::unique_ptr< TYPE >;
%enddef

View file

@ -25,6 +25,12 @@
SWIG_NewPointerObj(L, $1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN); SWIG_arg++;
%}
%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > {
void *vptr = 0;
int res = SWIG_ConvertPtr(L, $input, &vptr, $descriptor(TYPE *), 0);
$1 = SWIG_CheckState(res);
}
%template() std::auto_ptr< TYPE >;
%enddef

View file

@ -25,6 +25,12 @@
SWIG_NewPointerObj(L, $1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN); SWIG_arg++;
%}
%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > {
void *vptr = 0;
int res = SWIG_ConvertPtr(L, $input, &vptr, $descriptor(TYPE *), 0);
$1 = SWIG_CheckState(res);
}
%template() std::unique_ptr< TYPE >;
%enddef

View file

@ -25,6 +25,12 @@
%set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN));
%}
%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > {
void *vptr = 0;
int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0);
$1 = SWIG_CheckState(res);
}
%template() std::auto_ptr< TYPE >;
%enddef

View file

@ -25,6 +25,12 @@
%set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN));
%}
%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > {
void *vptr = 0;
int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0);
$1 = SWIG_CheckState(res);
}
%template() std::unique_ptr< TYPE >;
%enddef

View file

@ -25,6 +25,12 @@
%set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags));
%}
%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > {
void *vptr = 0;
int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0);
$1 = SWIG_CheckState(res);
}
%template() std::auto_ptr< TYPE >;
%enddef

View file

@ -25,6 +25,12 @@
%set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags));
%}
%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > {
void *vptr = 0;
int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0);
$1 = SWIG_CheckState(res);
}
%template() std::unique_ptr< TYPE >;
%enddef

View file

@ -25,6 +25,12 @@
%set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags));
%}
%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > {
void *vptr = 0;
int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0);
$1 = SWIG_CheckState(res);
}
%template() std::auto_ptr< TYPE >;
%enddef

View file

@ -25,6 +25,12 @@
%set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags));
%}
%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > {
void *vptr = 0;
int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0);
$1 = SWIG_CheckState(res);
}
%template() std::unique_ptr< TYPE >;
%enddef

View file

@ -27,6 +27,12 @@
SWIG_SetPointerZval($result, (void *)$1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN);
%}
%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > {
void *vptr = 0;
int res = SWIG_ConvertPtr(&$input, &vptr, $descriptor(TYPE *), 0);
$1 = SWIG_CheckState(res);
}
%template() std::auto_ptr< TYPE >;
%enddef

View file

@ -27,6 +27,12 @@
SWIG_SetPointerZval($result, (void *)$1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN);
%}
%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > {
void *vptr = 0;
int res = SWIG_ConvertPtr(&$input, &vptr, $descriptor(TYPE *), 0);
$1 = SWIG_CheckState(res);
}
%template() std::unique_ptr< TYPE >;
%enddef

View file

@ -25,6 +25,12 @@
%set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags));
%}
%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > {
void *vptr = 0;
int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0);
$1 = SWIG_CheckState(res);
}
%template() std::auto_ptr< TYPE >;
%enddef

View file

@ -25,6 +25,12 @@
%set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags));
%}
%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > {
void *vptr = 0;
int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0);
$1 = SWIG_CheckState(res);
}
%template() std::unique_ptr< TYPE >;
%enddef

View file

@ -25,6 +25,12 @@
%set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags));
%}
%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > {
void *vptr = 0;
int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0);
$1 = SWIG_CheckState(res);
}
%template() std::auto_ptr< TYPE >;
%enddef

View file

@ -25,6 +25,12 @@
%set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags));
%}
%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > {
void *vptr = 0;
int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0);
$1 = SWIG_CheckState(res);
}
%template() std::unique_ptr< TYPE >;
%enddef

View file

@ -25,6 +25,12 @@
Tcl_SetObjResult(interp, SWIG_NewInstanceObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN));
%}
%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > {
void *vptr = 0;
int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0);
$1 = SWIG_CheckState(res);
}
%template() std::auto_ptr< TYPE >;
%enddef

View file

@ -25,6 +25,12 @@
Tcl_SetObjResult(interp, SWIG_NewInstanceObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN));
%}
%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > {
void *vptr = 0;
int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0);
$1 = SWIG_CheckState(res);
}
%template() std::unique_ptr< TYPE >;
%enddef