summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam S Fulton <wsf@fultondesigns.co.uk>2013-04-18 23:20:48 +0100
committerWilliam S Fulton <wsf@fultondesigns.co.uk>2013-04-18 23:20:48 +0100
commit439a353a3686c97fa0b077fad8ce0c06326c1c95 (patch)
treeeb7a22abe4d843e0bca2223427276dee3e1e1ac1
parent9be3235988d73cc9445e633105d0146bb3c4acf5 (diff)
downloadswig-439a353a3686c97fa0b077fad8ce0c06326c1c95.tar.gz
Document patch #33 from previous commit and complete run time tests
-rw-r--r--CHANGES.current13
-rw-r--r--Examples/test-suite/csharp/special_variable_macros_runme.cs2
-rw-r--r--Examples/test-suite/d/special_variable_macros_runme.1.d4
-rw-r--r--Examples/test-suite/d/special_variable_macros_runme.2.d1
-rw-r--r--Examples/test-suite/go/special_variable_macros_runme.go3
-rw-r--r--Examples/test-suite/java/special_variable_macros_runme.java2
-rw-r--r--Source/Swig/fragment.c1
7 files changed, 26 insertions, 0 deletions
diff --git a/CHANGES.current b/CHANGES.current
index 4c1e55bc0..5022a3030 100644
--- a/CHANGES.current
+++ b/CHANGES.current
@@ -6,6 +6,19 @@ Version 2.0.10 (in progress)
============================
2013-04-18: wsfulton
+ Apply Patch #36 from Jesus Lopez to add support for $descriptor() special variable macro expansion
+ in fragments. For example:
+
+ %fragment("nameDescriptor", "header")
+ %{
+ static const char *nameDescriptor = "$descriptor(Name)";
+ %}
+
+ which will generate into the wrapper if the fragment is used:
+
+ static const char *nameDescriptor = "SWIGTYPE_Name";
+
+2013-04-18: wsfulton
Fix SF Bug #428 - Syntax error when preprocessor macros are defined inside of enum lists, such as:
typedef enum {
diff --git a/Examples/test-suite/csharp/special_variable_macros_runme.cs b/Examples/test-suite/csharp/special_variable_macros_runme.cs
index bd6fd4b04..1845cd074 100644
--- a/Examples/test-suite/csharp/special_variable_macros_runme.cs
+++ b/Examples/test-suite/csharp/special_variable_macros_runme.cs
@@ -12,6 +12,8 @@ public class runme {
throw new Exception("test failed");
if (special_variable_macros.testMary(name) != "SWIGTYPE_p_NameWrap")
throw new Exception("test failed");
+ if (special_variable_macros.testJames(name) != "SWIGTYPE_Name")
+ throw new Exception("test failed");
if (special_variable_macros.testJim(name) != "multiname num")
throw new Exception("test failed");
if (special_variable_macros.testJohn(new PairIntBool(10, false)) != 123)
diff --git a/Examples/test-suite/d/special_variable_macros_runme.1.d b/Examples/test-suite/d/special_variable_macros_runme.1.d
index 12491eef5..eab0331cc 100644
--- a/Examples/test-suite/d/special_variable_macros_runme.1.d
+++ b/Examples/test-suite/d/special_variable_macros_runme.1.d
@@ -24,6 +24,10 @@ void main() {
throw new Exception("test failed");
}
+ if (testJames(name) != "SWIGTYPE_Name") {
+ throw new Exception("test failed");
+ }
+
if (testJim(name) != "multiname num") {
throw new Exception("test failed");
}
diff --git a/Examples/test-suite/d/special_variable_macros_runme.2.d b/Examples/test-suite/d/special_variable_macros_runme.2.d
index 128e5870f..0bc4c0cc7 100644
--- a/Examples/test-suite/d/special_variable_macros_runme.2.d
+++ b/Examples/test-suite/d/special_variable_macros_runme.2.d
@@ -12,6 +12,7 @@ void main() {
enforce(testJack(name) == "$specialname");
enforce(testJill(name) == "jilly");
enforce(testMary(name) == "SWIGTYPE_p_NameWrap");
+ enforce(testJames(name) == "SWIGTYPE_Name");
enforce(testJim(name) == "multiname num");
enforce(testJohn(new PairIntBool(10, false)) == 123);
diff --git a/Examples/test-suite/go/special_variable_macros_runme.go b/Examples/test-suite/go/special_variable_macros_runme.go
index d049af606..c4f687ea9 100644
--- a/Examples/test-suite/go/special_variable_macros_runme.go
+++ b/Examples/test-suite/go/special_variable_macros_runme.go
@@ -16,6 +16,9 @@ func main() {
if special_variable_macros.TestMary(name) != "SWIGTYPE_p_NameWrap" {
panic("test failed")
}
+ if special_variable_macros.TestJames(name) != "SWIGTYPE_Name" {
+ panic("test failed")
+ }
if special_variable_macros.TestJim(name) != "multiname num" {
panic("test failed")
}
diff --git a/Examples/test-suite/java/special_variable_macros_runme.java b/Examples/test-suite/java/special_variable_macros_runme.java
index d7f8070b3..1cd50e96e 100644
--- a/Examples/test-suite/java/special_variable_macros_runme.java
+++ b/Examples/test-suite/java/special_variable_macros_runme.java
@@ -22,6 +22,8 @@ public class special_variable_macros_runme {
throw new RuntimeException("test failed");
if (!special_variable_macros.testMary(name).equals("SWIGTYPE_p_NameWrap"))
throw new RuntimeException("test failed");
+ if (!special_variable_macros.testJames(name).equals("SWIGTYPE_Name"))
+ throw new RuntimeException("test failed");
if (!special_variable_macros.testJim(name).equals("multiname num"))
throw new RuntimeException("test failed");
if (special_variable_macros.testJohn(new PairIntBool(10, false)) != 123)
diff --git a/Source/Swig/fragment.c b/Source/Swig/fragment.c
index 025994a84..927c772b8 100644
--- a/Source/Swig/fragment.c
+++ b/Source/Swig/fragment.c
@@ -18,6 +18,7 @@
#include "swig.h"
#include "swigwarn.h"
+#include "cparse.h"
static Hash *fragments = 0;
static Hash *looking_fragments = 0;