From 7f8bb02d78fe8ab3bff62f9cfd7a2c5b9825516c Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Sun, 7 Dec 2014 20:27:29 +0000 Subject: Fix regression in introduced in merge of C++11 strongly typed enums support - Guile constants bad casts generated - Go non-public enum value wrappers assert failure Also cosmetic test comment correction --- Source/Modules/go.cxx | 7 ++++--- Source/Modules/guile.cxx | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'Source') diff --git a/Source/Modules/go.cxx b/Source/Modules/go.cxx index 20a8650ef..eac83a5a5 100644 --- a/Source/Modules/go.cxx +++ b/Source/Modules/go.cxx @@ -1959,12 +1959,13 @@ private: * ------------------------------------------------------------------------ */ virtual int enumvalueDeclaration(Node *n) { - Swig_require("enumvalueDeclaration", n, "*sym:name", NIL); - Node *parent = parentNode(n); - if (!is_public(n)) { return SWIG_OK; } + + Swig_require("enumvalueDeclaration", n, "*sym:name", NIL); + Node *parent = parentNode(n); + if (Getattr(parent, "unnamed")) { Setattr(n, "type", NewString("int")); } else { diff --git a/Source/Modules/guile.cxx b/Source/Modules/guile.cxx index ce8d19c06..1c135b53d 100644 --- a/Source/Modules/guile.cxx +++ b/Source/Modules/guile.cxx @@ -1350,7 +1350,7 @@ public: Printv(f_header, tm, "\n", NIL); } else { // Create variable and assign it a value - Printf(f_header, "static %s = (%s)%s;\n", SwigType_str(type, var_name), type, rvalue); + Printf(f_header, "static %s = (%s)(%s);\n", SwigType_str(type, var_name), SwigType_str(type, 0), rvalue); } { /* Hack alert: will cleanup later -- Dave */ -- cgit v1.2.1