From 439a353a3686c97fa0b077fad8ce0c06326c1c95 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Thu, 18 Apr 2013 23:20:48 +0100 Subject: Document patch #33 from previous commit and complete run time tests --- CHANGES.current | 13 +++++++++++++ Examples/test-suite/csharp/special_variable_macros_runme.cs | 2 ++ Examples/test-suite/d/special_variable_macros_runme.1.d | 4 ++++ Examples/test-suite/d/special_variable_macros_runme.2.d | 1 + Examples/test-suite/go/special_variable_macros_runme.go | 3 +++ Examples/test-suite/java/special_variable_macros_runme.java | 2 ++ Source/Swig/fragment.c | 1 + 7 files changed, 26 insertions(+) diff --git a/CHANGES.current b/CHANGES.current index 4c1e55bc0..5022a3030 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -5,6 +5,19 @@ See the RELEASENOTES file for a summary of changes in each release. 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: 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; -- cgit v1.2.1