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:
parent
b1ee062d2a
commit
786d883d45
2 changed files with 18 additions and 1 deletions
|
|
@ -366,7 +366,7 @@
|
||||||
%{ $1 = ($1_ltype)$input; %}
|
%{ $1 = ($1_ltype)$input; %}
|
||||||
|
|
||||||
%typemap(out) enum SWIGTYPE
|
%typemap(out) enum SWIGTYPE
|
||||||
%{ $result = $1; %}
|
%{ $result = (intgo)$1; %}
|
||||||
|
|
||||||
%typemap(directorin) enum SWIGTYPE
|
%typemap(directorin) enum SWIGTYPE
|
||||||
%{ $input = ($1_ltype)$1; %}
|
%{ $input = ($1_ltype)$1; %}
|
||||||
|
|
@ -374,6 +374,18 @@
|
||||||
%typemap(directorout) enum SWIGTYPE
|
%typemap(directorout) enum SWIGTYPE
|
||||||
%{ $result = ($1_ltype)$input; %}
|
%{ $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.
|
/* 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
|
We convert it to a pointer for the Go code. Note that all basic
|
||||||
types are explicitly handled above. */
|
types are explicitly handled above. */
|
||||||
|
|
|
||||||
|
|
@ -4709,6 +4709,11 @@ private:
|
||||||
Delete(q);
|
Delete(q);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Language::enumLookup(t) != NULL || Strcmp(t, "enum ") == 0) {
|
||||||
|
is_int = true;
|
||||||
|
}
|
||||||
|
|
||||||
Delete(t);
|
Delete(t);
|
||||||
if (is_int8) {
|
if (is_int8) {
|
||||||
ret = NewString("char ");
|
ret = NewString("char ");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue