use better names to avoid clashing with directors, as reported by Eric Blossom
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9038 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
264387f53e
commit
418b2d8ea3
3 changed files with 70 additions and 71 deletions
|
|
@ -70,35 +70,35 @@
|
|||
|
||||
%define %ptr_directorout_typemap(asptr_meth,frag,Type...)
|
||||
%typemap(directorargout,noblock=1,fragment=frag) Type *DIRECTOROUT ($*ltype temp) {
|
||||
Type *optr = 0;
|
||||
int ores = $input ? asptr_meth($input, &optr) : 0;
|
||||
if (!SWIG_IsOK(ores) || !optr) {
|
||||
%dirout_fail((optr ? ores : SWIG_TypeError),"$type");
|
||||
Type *swig_optr = 0;
|
||||
int swig_ores = $input ? asptr_meth($input, &swig_optr) : 0;
|
||||
if (!SWIG_IsOK(swig_ores) || !swig_optr) {
|
||||
%dirout_fail((swig_optr ? swig_ores : SWIG_TypeError),"$type");
|
||||
}
|
||||
temp = *optr;
|
||||
temp = *swig_optr;
|
||||
$result = &temp;
|
||||
if (SWIG_IsNewObj(ores)) %delete(optr);
|
||||
if (SWIG_IsNewObj(swig_ores)) %delete(swig_optr);
|
||||
}
|
||||
|
||||
%typemap(directorout,noblock=1,fragment=frag) Type {
|
||||
Type *optr = 0;
|
||||
int ores = asptr_meth($input, &optr);
|
||||
if (!SWIG_IsOK(ores) || !optr) {
|
||||
%dirout_fail((optr ? ores : SWIG_TypeError),"$type");
|
||||
Type *swig_optr = 0;
|
||||
int swig_ores = asptr_meth($input, &swig_optr);
|
||||
if (!SWIG_IsOK(swig_ores) || !swig_optr) {
|
||||
%dirout_fail((swig_optr ? swig_ores : SWIG_TypeError),"$type");
|
||||
}
|
||||
$result = *optr;
|
||||
if (SWIG_IsNewObj(ores)) %delete(optr);
|
||||
$result = *swig_optr;
|
||||
if (SWIG_IsNewObj(swig_ores)) %delete(swig_optr);
|
||||
}
|
||||
|
||||
%typemap(directorout,noblock=1,fragment=frag,warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) Type* {
|
||||
Type *optr = 0;
|
||||
int ores = asptr_meth($input, &optr);
|
||||
if (!SWIG_IsOK(ores)) {
|
||||
%dirout_fail(ores,"$type");
|
||||
Type *swig_optr = 0;
|
||||
int swig_ores = asptr_meth($input, &swig_optr);
|
||||
if (!SWIG_IsOK(swig_ores)) {
|
||||
%dirout_fail(swig_ores,"$type");
|
||||
}
|
||||
$result = optr;
|
||||
if (SWIG_IsNewObj(ores)) {
|
||||
swig_acquire_ownership(optr);
|
||||
$result = swig_optr;
|
||||
if (SWIG_IsNewObj(swig_ores)) {
|
||||
swig_acquire_ownership(swig_optr);
|
||||
}
|
||||
}
|
||||
%typemap(directorfree,noblock=1) Type*
|
||||
|
|
@ -109,18 +109,18 @@
|
|||
}
|
||||
|
||||
%typemap(directorout,noblock=1,fragment=frag,warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) Type& {
|
||||
Type *optr = 0;
|
||||
int ores = asptr_meth($input, &optr);
|
||||
if (!SWIG_IsOK(ores)) {
|
||||
%dirout_fail(ores,"$type");
|
||||
Type *swig_optr = 0;
|
||||
int swig_ores = asptr_meth($input, &swig_optr);
|
||||
if (!SWIG_IsOK(swig_ores)) {
|
||||
%dirout_fail(swig_ores,"$type");
|
||||
} else {
|
||||
if (!optr) {
|
||||
if (!swig_optr) {
|
||||
%dirout_nullref("$type");
|
||||
}
|
||||
}
|
||||
$result = optr;
|
||||
if (SWIG_IsNewObj(ores)) {
|
||||
swig_acquire_ownership(optr);
|
||||
$result = swig_optr;
|
||||
if (SWIG_IsNewObj(swig_ores)) {
|
||||
swig_acquire_ownership(swig_optr);
|
||||
}
|
||||
}
|
||||
%typemap(directorfree,noblock=1) Type&
|
||||
|
|
|
|||
|
|
@ -351,31 +351,31 @@
|
|||
|
||||
/* directorout */
|
||||
#if defined(__cplusplus) && defined(%implicitconv_flag)
|
||||
%typemap(directorout,noblock=1,implicitconv=1) SWIGTYPE (void * argp, int res = 0) {
|
||||
res = SWIG_ConvertPtr($input,&argp,$&descriptor, %convertptr_flags | %implicitconv_flag);
|
||||
if (!SWIG_IsOK(res)) {
|
||||
%dirout_fail(res,"$type");
|
||||
%typemap(directorout,noblock=1,implicitconv=1) SWIGTYPE (void * swig_argp, int swig_res = 0) {
|
||||
swig_res = SWIG_ConvertPtr($input,&swig_argp,$&descriptor, %convertptr_flags | %implicitconv_flag);
|
||||
if (!SWIG_IsOK(swig_res)) {
|
||||
%dirout_fail(swig_res,"$type");
|
||||
}
|
||||
$result = *(%reinterpret_cast(argp, $<ype));
|
||||
if (SWIG_IsNewObj(res)) %delete(%reinterpret_cast(argp, $<ype));
|
||||
$result = *(%reinterpret_cast(swig_argp, $<ype));
|
||||
if (SWIG_IsNewObj(swig_res)) %delete(%reinterpret_cast(swig_argp, $<ype));
|
||||
}
|
||||
#else
|
||||
%typemap(directorout,noblock=1) SWIGTYPE (void * argp, int res = 0) {
|
||||
res = SWIG_ConvertPtr($input,&argp,$&descriptor, %convertptr_flags);
|
||||
if (!SWIG_IsOK(res)) {
|
||||
%dirout_fail(res,"$type");
|
||||
%typemap(directorout,noblock=1) SWIGTYPE (void * swig_argp, int swig_res = 0) {
|
||||
swig_res = SWIG_ConvertPtr($input,&swig_argp,$&descriptor, %convertptr_flags);
|
||||
if (!SWIG_IsOK(swig_res)) {
|
||||
%dirout_fail(swig_res,"$type");
|
||||
}
|
||||
$result = *(%reinterpret_cast(argp, $<ype));
|
||||
$result = *(%reinterpret_cast(swig_argp, $<ype));
|
||||
}
|
||||
#endif
|
||||
|
||||
%typemap(directorout,noblock=1,warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG)
|
||||
SWIGTYPE *(void *argp, int res, swig_owntype own) {
|
||||
res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor, %convertptr_flags | SWIG_POINTER_DISOWN, &own);
|
||||
if (!SWIG_IsOK(res)) {
|
||||
%dirout_fail(res,"$type");
|
||||
SWIGTYPE *(void *swig_argp, int swig_res, swig_owntype own) {
|
||||
swig_res = SWIG_ConvertPtrAndOwn($input, &swig_argp, $descriptor, %convertptr_flags | SWIG_POINTER_DISOWN, &own);
|
||||
if (!SWIG_IsOK(swig_res)) {
|
||||
%dirout_fail(swig_res,"$type");
|
||||
}
|
||||
$result = %reinterpret_cast(argp, $ltype);
|
||||
$result = %reinterpret_cast(swig_argp, $ltype);
|
||||
swig_acquire_ownership_obj(%as_voidptr($result), own);
|
||||
}
|
||||
%typemap(directorfree,noblock=1,match="directorout") SWIGTYPE * {
|
||||
|
|
@ -385,13 +385,13 @@
|
|||
}
|
||||
|
||||
%typemap(directorout,noblock=1,warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG)
|
||||
SWIGTYPE &(void *argp, int res, swig_owntype own) {
|
||||
res = SWIG_ConvertPtrAndOwn($input, &argp, $descriptor, %convertptr_flags | SWIG_POINTER_DISOWN, &own);
|
||||
if (!SWIG_IsOK(res)) {
|
||||
%dirout_fail(res,"$type");
|
||||
SWIGTYPE &(void *swig_argp, int swig_res, swig_owntype own) {
|
||||
swig_res = SWIG_ConvertPtrAndOwn($input, &swig_argp, $descriptor, %convertptr_flags | SWIG_POINTER_DISOWN, &own);
|
||||
if (!SWIG_IsOK(swig_res)) {
|
||||
%dirout_fail(swig_res,"$type");
|
||||
}
|
||||
if (!argp) { %dirout_nullref("$type"); }
|
||||
$result = %reinterpret_cast(argp, $ltype);
|
||||
if (!swig_argp) { %dirout_nullref("$type"); }
|
||||
$result = %reinterpret_cast(swig_argp, $ltype);
|
||||
swig_acquire_ownership_obj(%as_voidptr($result), own);
|
||||
}
|
||||
%typemap(directorfree,noblock=1,match="directorout") SWIGTYPE & {
|
||||
|
|
@ -480,11 +480,10 @@
|
|||
/* directorout */
|
||||
|
||||
%typemap(directorout) SWIGTYPE (CLASS::*) {
|
||||
int res = SWIG_ConvertMember($input,%as_voidptr(&$result), sizeof($type), $descriptor);
|
||||
if (!SWIG_IsOK(res)) {
|
||||
%dirout_fail(res,"$type");
|
||||
int swig_res = SWIG_ConvertMember($input,%as_voidptr(&$result), sizeof($type), $descriptor);
|
||||
if (!SWIG_IsOK(swig_res)) {
|
||||
%dirout_fail(swig_res,"$type");
|
||||
}
|
||||
$result = %reinterpret_cast(argp, $ltype);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -541,9 +540,9 @@
|
|||
/* directorout */
|
||||
|
||||
%typemap(directorout) SWIGTYPE ((*)(ANY)) {
|
||||
int res = SWIG_ConvertFunctionPtr($input,(void**)(&$result),$descriptor);
|
||||
if (!SWIG_IsOK(res)) {
|
||||
%dirout_fail(res,"$type");
|
||||
int swig_res = SWIG_ConvertFunctionPtr($input,(void**)(&$result),$descriptor);
|
||||
if (!SWIG_IsOK(swig_res)) {
|
||||
%dirout_fail(swig_res,"$type");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -108,28 +108,28 @@
|
|||
|
||||
%define %value_directorout_typemap(asval_meth,frag,Type...)
|
||||
%typemap(directorargout,noblock=1,fragment=frag) Type *DIRECTOROUT {
|
||||
Type val;
|
||||
int res = asval_meth($input, &val);
|
||||
if (!SWIG_IsOK(res)) {
|
||||
%dirout_fail(res, "$type");
|
||||
Type swig_val;
|
||||
int swig_res = asval_meth($input, &swig_val);
|
||||
if (!SWIG_IsOK(swig_res)) {
|
||||
%dirout_fail(swig_res, "$type");
|
||||
}
|
||||
*$result = %static_cast(val, $type);
|
||||
*$result = %static_cast(swig_val, $type);
|
||||
}
|
||||
%typemap(directorout,noblock=1,fragment=frag) Type {
|
||||
Type val;
|
||||
int res = asval_meth($input, &val);
|
||||
if (!SWIG_IsOK(res)) {
|
||||
%dirout_fail(res, "$type");
|
||||
Type swig_val;
|
||||
int swig_res = asval_meth($input, &swig_val);
|
||||
if (!SWIG_IsOK(swig_res)) {
|
||||
%dirout_fail(swig_res, "$type");
|
||||
}
|
||||
$result = %static_cast(val,$type);
|
||||
$result = %static_cast(swig_val,$type);
|
||||
}
|
||||
%typemap(directorout,noblock=1,fragment=frag,warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) const Type& {
|
||||
Type val;
|
||||
int res = asval_meth($input, &val);
|
||||
if (!SWIG_IsOK(res)) {
|
||||
%dirout_fail(res, "$type");
|
||||
Type swig_val;
|
||||
int swig_res = asval_meth($input, &swig_val);
|
||||
if (!SWIG_IsOK(swig_res)) {
|
||||
%dirout_fail(swig_res, "$type");
|
||||
}
|
||||
$basetype *temp = new $basetype(($basetype)val);
|
||||
$basetype *temp = new $basetype(($basetype)swig_val);
|
||||
swig_acquire_ownership(temp);
|
||||
$result = temp;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue