Fixed problem in handling of void pointers.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@764 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
4d947b3c8e
commit
90a7839b0c
1 changed files with 6 additions and 2 deletions
|
|
@ -464,14 +464,17 @@ get_pointer(char *iname, char *srcname, char *src, char *dest,
|
|||
SwigType *t, String *f, char *ret) {
|
||||
|
||||
SwigType_remember(t);
|
||||
SwigType *lt = Swig_clocal_type(t);
|
||||
Printv(f, "if (SWIG_ConvertPtr(", src, ",(void **) &", dest, ",", 0);
|
||||
|
||||
/* If we're passing a void pointer, we give the pointer conversion a NULL
|
||||
pointer, otherwise pass in the expected type. */
|
||||
|
||||
if (SwigType_type(t) == T_VOID) Printf(f, " 0 ) < 0) {\n");
|
||||
else
|
||||
if (Cmp(lt,"p.void") == 0) {
|
||||
Printf(f, " 0 ) < 0) {\n");
|
||||
} else {
|
||||
Printv(f, "SWIGTYPE", SwigType_manglestr(t), ") < 0) {\n",0);
|
||||
}
|
||||
|
||||
Printv(f,
|
||||
"croak(\"Type error in ", srcname, " of ", iname,". Expected %s\", SWIGTYPE",
|
||||
|
|
@ -479,6 +482,7 @@ get_pointer(char *iname, char *srcname, char *src, char *dest,
|
|||
ret, ";\n",
|
||||
"}\n",
|
||||
0);
|
||||
Delete(lt);
|
||||
}
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue