Add c++11 strongly typed enum support for Guile
This commit is contained in:
parent
713d3d5973
commit
cf3be359cf
2 changed files with 4 additions and 4 deletions
|
|
@ -172,11 +172,11 @@
|
||||||
}
|
}
|
||||||
* (int *) &($1) = scm_to_int($input);
|
* (int *) &($1) = scm_to_int($input);
|
||||||
}
|
}
|
||||||
%typemap(out) enum SWIGTYPE { $result = scm_from_long($1); }
|
%typemap(out) enum SWIGTYPE { $result = scm_from_long((int)$1); }
|
||||||
%typemap(varout) enum SWIGTYPE { $result = scm_from_long($1); }
|
%typemap(varout) enum SWIGTYPE { $result = scm_from_long((int)$1); }
|
||||||
%typemap(throws) enum SWIGTYPE {
|
%typemap(throws) enum SWIGTYPE {
|
||||||
scm_throw(scm_from_locale_symbol((char *) "swig-exception"),
|
scm_throw(scm_from_locale_symbol((char *) "swig-exception"),
|
||||||
scm_listify(scm_from_long($1), SCM_UNDEFINED));
|
scm_listify(scm_from_long((int)$1), SCM_UNDEFINED));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The SIMPLE_MAP_WITH_EXPR macro below defines the whole set of
|
/* The SIMPLE_MAP_WITH_EXPR macro below defines the whole set of
|
||||||
|
|
|
||||||
|
|
@ -1350,7 +1350,7 @@ public:
|
||||||
Printv(f_header, tm, "\n", NIL);
|
Printv(f_header, tm, "\n", NIL);
|
||||||
} else {
|
} else {
|
||||||
// Create variable and assign it a value
|
// Create variable and assign it a value
|
||||||
Printf(f_header, "static %s = %s;\n", SwigType_str(type, var_name), rvalue);
|
Printf(f_header, "static %s = (%s)%s;\n", SwigType_str(type, var_name), type, rvalue);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
/* Hack alert: will cleanup later -- Dave */
|
/* Hack alert: will cleanup later -- Dave */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue