Fix Go support for enums to work correctly when Go int type is 64 bits.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13875 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Ian Lance Taylor 2012-10-30 23:38:57 +00:00
commit 786d883d45
2 changed files with 18 additions and 1 deletions

View file

@ -366,7 +366,7 @@
%{ $1 = ($1_ltype)$input; %}
%typemap(out) enum SWIGTYPE
%{ $result = $1; %}
%{ $result = (intgo)$1; %}
%typemap(directorin) enum SWIGTYPE
%{ $input = ($1_ltype)$1; %}
@ -374,6 +374,18 @@
%typemap(directorout) enum SWIGTYPE
%{ $result = ($1_ltype)$input; %}
%typemap(directorin) enum SWIGTYPE & (intgo e)
%{
e = (intgo)$1;
$input = &e;
%}
%typemap(directorout) enum SWIGTYPE &
%{
$*1_ltype f = ($*1_ltype)*$input;
$result = ($1_ltype)&f;
%}
/* Arbitrary type. This is a type passed by value in the C/C++ code.
We convert it to a pointer for the Go code. Note that all basic
types are explicitly handled above. */