varin enum SWIGTYPE mods to handle unnamed enums
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6149 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
8568295425
commit
2631309c2f
1 changed files with 7 additions and 3 deletions
|
|
@ -225,7 +225,7 @@
|
|||
|
||||
/* 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);";
|
||||
|
||||
%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 []
|
||||
{ croak("Variable $symname is read-only."); }
|
||||
|
||||
%typemap(varin) enum SWIGTYPE
|
||||
"$1 = ($1_type) SvIV($input);";
|
||||
%typemap(varin) enum SWIGTYPE {
|
||||
if (sizeof(int) != sizeof($1)) {
|
||||
croak("enum variable '$name' can not be set.");
|
||||
}
|
||||
*(int *)(void *)&($1) = SvIV($input);
|
||||
}
|
||||
|
||||
/* --- Typemaps for variable output --- */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue