fixes to compile OSS

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7681 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2005-10-18 15:20:17 +00:00
commit bdb92681d5
3 changed files with 8 additions and 11 deletions

View file

@ -37,7 +37,7 @@
#if defined(__cplusplus)
# define SWIG_new(Type...) (new Type)
# define SWIG_new_copy(val,Type...) (new Type(val))
# define SWIG_new_copy(val,Type...) (new Type(SWIG_static_cast(val, const Type&)))
# define SWIG_new_array(size,Type...) (new Type[size])
# define SWIG_new_copy_array(ptr,size,Type...) SWIG_reinterpret_cast(memcpy(SWIG_new_array(size,Type), ptr, sizeof(Type)*(size)), Type*)
# define SWIG_delete(cptr) delete cptr

View file

@ -309,7 +309,7 @@
if (SWIG_ConvertPtr($input,&argp,$&descriptor, 0) != SWIG_OK) {
SWIG_dout_fail(SWIG_TypeError,"$type");
}
$result = *(SWIG_reinterpret_cast(argp, $&ltype);
$result = *(SWIG_reinterpret_cast(argp, $&ltype));
}
%typemap(directorout,noblock=1) SWIGTYPE *(void *argp), SWIGTYPE [](void *argp) {
if (SWIG_ConvertPtr($input, &argp, $descriptor, 0) != SWIG_OK) {

View file

@ -89,28 +89,25 @@
int res = asval_meth($input, &val);
if (res != SWIG_OK) {
SWIG_dout_fail(res, "$type");
} else {
*$result = SWIG_static_cast(val, $type);
}
}
*$result = SWIG_static_cast(val, $type);
}
%typemap(directorout,noblock=1,fragment=frag) Type {
Type val;
int res = asval_meth($input, &val);
if (res != SWIG_OK) {
SWIG_dout_fail(res, "$type");
} else {
$result = SWIG_static_cast(val,$type);
}
$result = SWIG_static_cast(val,$type);
}
%typemap(directorout,noblock=1,fragment=frag,warning=SWIG_WARN_TYPEMAP_THREAD_UNSAFE) const Type& {
Type val;
int res = asval_meth($input, &val);
if (res != SWIG_OK) {
SWIG_dout_fail(res, "$type");
} else {
static $basetype temp = SWIG_static_cast(val, $basetype);
$result = &temp;
}
}
static $basetype temp = SWIG_static_cast(val, $basetype);
$result = &temp;
}
%typemap(directorout,fragment=frag) Type &DIRECTOROUT = Type
%enddef