For Go: Fix handling of INPUT variables when using typemaps.i. This
fixes cases where the gotype typemap is used to produce a simple Go type for a non-simple C/C++ type. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12498 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
6c02fa5729
commit
7ac265ff3d
2 changed files with 30 additions and 2 deletions
|
|
@ -4533,6 +4533,20 @@ private:
|
|||
bool is_member = Strcmp(gt, "_swig_memberptr") == 0;
|
||||
bool is_complex64 = Strcmp(gt, "complex64") == 0;
|
||||
bool is_complex128 = Strcmp(gt, "complex128") == 0;
|
||||
bool is_char = false;
|
||||
bool is_short = false;
|
||||
bool is_int = false;
|
||||
bool is_long = false;
|
||||
bool is_float = false;
|
||||
bool is_double = false;
|
||||
if ((n != NULL && Getattr(n, "tmap:gotype") != NULL) || hasGoTypemap(type)) {
|
||||
is_char = Strcmp(gt, "int8") == 0 || Strcmp(gt, "uint8") == 0 || Strcmp(gt, "byte") == 0;
|
||||
is_short = Strcmp(gt, "int16") == 0 || Strcmp(gt, "uint16") == 0;
|
||||
is_int = Strcmp(gt, "int") == 0 || Strcmp(gt, "int32") == 0 || Strcmp(gt, "uint32") == 0;
|
||||
is_long = Strcmp(gt, "int64") == 0 || Strcmp(gt, "uint64") == 0;
|
||||
is_float = Strcmp(gt, "float32") == 0;
|
||||
is_double = Strcmp(gt, "float64") == 0;
|
||||
}
|
||||
Delete(gt);
|
||||
|
||||
String *ret;
|
||||
|
|
@ -4588,7 +4602,21 @@ private:
|
|||
}
|
||||
}
|
||||
Delete(t);
|
||||
return SwigType_lstr(type, name);
|
||||
if (is_char) {
|
||||
ret = NewString("char ");
|
||||
} else if (is_short) {
|
||||
ret = NewString("short ");
|
||||
} else if (is_int) {
|
||||
ret = NewString("int ");
|
||||
} else if (is_long) {
|
||||
ret = NewString("long long ");
|
||||
} else if (is_float) {
|
||||
ret = NewString("float ");
|
||||
} else if (is_double) {
|
||||
ret = NewString("double ");
|
||||
} else {
|
||||
return SwigType_lstr(type, name);
|
||||
}
|
||||
}
|
||||
|
||||
if (SwigType_isreference(type)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue