varin enum SWIGTYPE mods to handle unnamed enums
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6149 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
634304dc98
commit
3a0d6f1a7e
1 changed files with 7 additions and 3 deletions
|
|
@ -225,7 +225,7 @@
|
||||||
|
|
||||||
/* Variable input */
|
/* Variable input */
|
||||||
|
|
||||||
%typemap(varin) int, short, long, signed char, bool, enum SWIGTYPE
|
%typemap(varin) int, short, long, signed char, bool
|
||||||
"$1 = ($1_ltype) SvIV($input);";
|
"$1 = ($1_ltype) SvIV($input);";
|
||||||
|
|
||||||
%typemap(varin) unsigned int, unsigned short, unsigned long, unsigned char
|
%typemap(varin) unsigned int, unsigned short, unsigned long, unsigned char
|
||||||
|
|
@ -361,8 +361,12 @@
|
||||||
%typemap(varin,warning="462: Unable to set variable of type char []") char []
|
%typemap(varin,warning="462: Unable to set variable of type char []") char []
|
||||||
{ croak("Variable $symname is read-only."); }
|
{ croak("Variable $symname is read-only."); }
|
||||||
|
|
||||||
%typemap(varin) enum SWIGTYPE
|
%typemap(varin) enum SWIGTYPE {
|
||||||
"$1 = ($1_type) SvIV($input);";
|
if (sizeof(int) != sizeof($1)) {
|
||||||
|
croak("enum variable '$name' can not be set.");
|
||||||
|
}
|
||||||
|
*(int *)(void *)&($1) = SvIV($input);
|
||||||
|
}
|
||||||
|
|
||||||
/* --- Typemaps for variable output --- */
|
/* --- Typemaps for variable output --- */
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue