Fix handling of anonymous-enum variables.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7276 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
904e528dd9
commit
47f0f21ebf
1 changed files with 11 additions and 1 deletions
|
|
@ -122,7 +122,17 @@
|
|||
/* Enums */
|
||||
|
||||
%typemap(in) enum SWIGTYPE { $1 = ($1_type) gh_scm2int($input); }
|
||||
%typemap(varin) enum SWIGTYPE { $1 = ($1_type) gh_scm2int($input); }
|
||||
/* The complicated construction below needed to deal with anonymous
|
||||
enums, which cannot be cast to. */
|
||||
%typemap(varin) enum SWIGTYPE {
|
||||
if (sizeof(int) != sizeof($1)) {
|
||||
scm_error(scm_str2symbol("swig-error"),
|
||||
(char *) FUNC_NAME,
|
||||
(char *) "enum variable '$name' cannot be set",
|
||||
SCM_EOL, SCM_BOOL_F);
|
||||
}
|
||||
* (int *) &($1) = gh_scm2int($input);
|
||||
}
|
||||
%typemap(out) enum SWIGTYPE { $result = gh_int2scm($1); }
|
||||
%typemap(varout) enum SWIGTYPE { $result = gh_int2scm($1); }
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue