add implicitconv support and cosmetics for cast rank
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8095 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
e4e72e63fa
commit
0e4b388ec9
24 changed files with 484 additions and 308 deletions
|
|
@ -5,14 +5,14 @@
|
|||
/* in */
|
||||
|
||||
%typemap(in,noblock=1) void * {
|
||||
if (SWIG_ConvertPtr($input,%as_voidptrptr(&$1), 0, $disown) != SWIG_OK) {
|
||||
if (!SWIG_IsOK(SWIG_ConvertPtr($input,%as_voidptrptr(&$1), 0, $disown))) {
|
||||
%argument_fail(SWIG_TypeError, "$type", $argnum);
|
||||
}
|
||||
}
|
||||
%typemap(freearg) void * "";
|
||||
|
||||
%typemap(in,noblock=1) void * const& ($*ltype temp) {
|
||||
if (SWIG_ConvertPtr($input, %as_voidptrptr(&temp), 0, $disown) != SWIG_OK) {
|
||||
if (!SWIG_IsOK(SWIG_ConvertPtr($input, %as_voidptrptr(&temp), 0, $disown))) {
|
||||
%argument_fail(SWIG_TypeError, "Stype", $argnum);
|
||||
}
|
||||
$1 = &temp;
|
||||
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
%typemap(varin,noblock=1) void * {
|
||||
void *temp = 0;
|
||||
if (SWIG_ConvertPtr($input, &temp, 0, SWIG_POINTER_DISOWN) != SWIG_OK) {
|
||||
if (!SWIG_IsOK(SWIG_ConvertPtr($input, &temp, 0, SWIG_POINTER_DISOWN))) {
|
||||
%variable_fail(SWIG_TypeError, "$type", "$name");
|
||||
}
|
||||
$1 = ($1_ltype) temp;
|
||||
|
|
@ -43,7 +43,8 @@
|
|||
%typecheck(SWIG_TYPECHECK_VOIDPTR, noblock=1) void *
|
||||
{
|
||||
void *ptr = 0;
|
||||
$1 = (SWIG_ConvertPtr($input, &ptr, 0, 0) == SWIG_OK);
|
||||
int res = SWIG_ConvertPtr($input, &ptr, 0, 0);
|
||||
$1 = SWIG_CheckState(res);
|
||||
}
|
||||
|
||||
#if defined(SWIG_DIRECTOR_TYPEMAPS)
|
||||
|
|
@ -58,14 +59,14 @@
|
|||
/* directorout */
|
||||
|
||||
%typemap(directorout,noblock=1) void * (void *argp) {
|
||||
if (SWIG_ConvertPtr($input, &argp, 0, 0) != SWIG_OK) {
|
||||
if (!SWIG_IsOK(SWIG_ConvertPtr($input, &argp, 0, 0))) {
|
||||
%dirout_fail(SWIG_TypeError,"$type");
|
||||
}
|
||||
$result = %reinterpret_cast(argp, $ltype);
|
||||
}
|
||||
|
||||
%typemap(directorout,noblock=1,warning=SWIG_WARN_TYPEMAP_THREAD_UNSAFE) void * const& (void *argp) {
|
||||
if (SWIG_ConvertPtr($input, &argp, 0, $disown) != SWIG_OK) {
|
||||
%typemap(directorout,noblock=1,warning=SWIG_WARN_TYPEMAP_DIRECTOROUT_PTR) void * const& (void *argp) {
|
||||
if (!SWIG_IsOK(SWIG_ConvertPtr($input, &argp, 0, $disown))) {
|
||||
%dirout_fail(SWIG_TypeError,"$type");
|
||||
}
|
||||
static $*ltype temp = %reinterpret_cast(argp, $*ltype);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue