summaryrefslogtreecommitdiff
path: root/Source/Modules/go.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Modules/go.cxx')
-rw-r--r--Source/Modules/go.cxx18
1 files changed, 17 insertions, 1 deletions
diff --git a/Source/Modules/go.cxx b/Source/Modules/go.cxx
index 002247fe5..7fa9b2670 100644
--- a/Source/Modules/go.cxx
+++ b/Source/Modules/go.cxx
@@ -1362,6 +1362,10 @@ private:
goargout(info->parms);
if (SwigType_type(info->result) != T_VOID) {
+
+ Swig_save("cgoGoWrapper", info->n, "type", "tmap:goout", NULL);
+ Setattr(info->n, "type", info->result);
+
String *goout = goTypemapLookup("goout", info->n, "swig_r");
if (goout == NULL) {
Printv(f_go_wrappers, "\treturn swig_r\n", NULL);
@@ -1374,6 +1378,8 @@ private:
Printv(f_go_wrappers, goout, "\n", NULL);
Printv(f_go_wrappers, "\treturn swig_r_1\n", NULL);
}
+
+ Swig_restore(info->n);
}
Printv(f_go_wrappers, "}\n\n", NULL);
@@ -1618,8 +1624,13 @@ private:
receiver = NULL;
}
+ Swig_save("cgoGoWrapper", n, "type", "tmap:goout", NULL);
+ Setattr(n, "type", result);
+
String *goout = goTypemapLookup("goout", n, "swig_r");
+ Swig_restore(n);
+
bool add_to_interface = (interfaces && !is_constructor && !is_destructor && !is_static && !overname && checkFunctionVisibility(n, NULL));
bool needs_wrapper = (gccgo_flag || receiver || is_constructor || is_destructor || parm_count > required_count);
@@ -2712,6 +2723,9 @@ private:
* ---------------------------------------------------------------------- */
virtual int enumDeclaration(Node *n) {
+ if (getCurrentClass() && (cplus_mode != PUBLIC))
+ return SWIG_NOWRAP;
+
String *name = goEnumName(n);
if (Strcmp(name, "int") != 0) {
if (!ImportMode || !imported_package) {
@@ -2792,6 +2806,7 @@ private:
} else if (SwigType_type(type) == T_CHAR) {
quote = '\'';
} else if (SwigType_type(type) == T_STRING) {
+ Printv(get, "(char *)", NULL);
quote = '"';
} else {
quote = '\0';
@@ -4161,7 +4176,6 @@ private:
Wrapper *dummy = NewWrapper();
emit_attach_parmmaps(parms, dummy);
- DelWrapper(dummy);
Swig_typemap_attach_parms("gotype", parms, NULL);
Swig_typemap_attach_parms("imtype", parms, NULL);
@@ -4218,6 +4232,8 @@ private:
Swig_typemap_attach_parms("goin", parms, dummy);
Swig_typemap_attach_parms("goargout", parms, dummy);
+ DelWrapper(dummy);
+
if (!is_ignored) {
// We use an interface to see if this method is defined in Go.
Printv(f_go_wrappers, "type ", interface_name, " interface {\n", NULL);