From eef3f9169df8a33ee2dc8ad93f8f8a4d0e602dfc Mon Sep 17 00:00:00 2001 From: Marcelo Matus Date: Fri, 16 Sep 2005 00:35:38 +0000 Subject: [PATCH] fix example max macro/template and external max macro conflicts git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7449 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Examples/test-suite/cpp_broken.i | 6 ++++++ Examples/test-suite/member_template.i | 8 ++++++++ Examples/test-suite/name_warnings.i | 6 ++++++ Examples/test-suite/namespace_template.i | 6 ++++++ Examples/test-suite/overload_template.i | 7 +++++++ Examples/test-suite/template.i | 6 ++++++ Examples/test-suite/template_explicit.i | 5 +++++ Examples/test-suite/wrapmacro.i | 5 +++++ 8 files changed, 49 insertions(+) diff --git a/Examples/test-suite/cpp_broken.i b/Examples/test-suite/cpp_broken.i index 988b785db..fe109ea43 100644 --- a/Examples/test-suite/cpp_broken.i +++ b/Examples/test-suite/cpp_broken.i @@ -19,6 +19,12 @@ FIELD(b, NEXT_CONST); } MyStruct_t; %} +%{ +#ifdef max +#undef max +#endif +%} + // bug #994301 %inline %{ #define max(a,b) ((a) > (b) ? (a) : (b)) diff --git a/Examples/test-suite/member_template.i b/Examples/test-suite/member_template.i index aafbd98f3..6a1cb3363 100644 --- a/Examples/test-suite/member_template.i +++ b/Examples/test-suite/member_template.i @@ -1,5 +1,13 @@ %module member_template +%{ +#ifdef max +#undef max +#endif +%} + + + %inline %{ template T max(T x, T y, T z) { return (x > y) ? x : y; } diff --git a/Examples/test-suite/name_warnings.i b/Examples/test-suite/name_warnings.i index 586fd1f52..5247004b9 100644 --- a/Examples/test-suite/name_warnings.i +++ b/Examples/test-suite/name_warnings.i @@ -12,6 +12,12 @@ /* activate all the name warnings */ %warnfilter(+315,+321,-403); +%{ +#ifdef max +#undef max +#endif +%} + %inline { class string; // csharp keyword diff --git a/Examples/test-suite/namespace_template.i b/Examples/test-suite/namespace_template.i index 1a0cfb6b2..b707b0bc7 100644 --- a/Examples/test-suite/namespace_template.i +++ b/Examples/test-suite/namespace_template.i @@ -7,6 +7,12 @@ %warnfilter(801) test3::vector; /* Ruby, wrong class name */ %warnfilter(801) vector; /* Ruby, wrong class name */ +%{ +#ifdef max +#undef max +#endif +%} + %{ namespace test { template T max(T a, T b) { return (a > b) ? a : b; } diff --git a/Examples/test-suite/overload_template.i b/Examples/test-suite/overload_template.i index 4121763cf..93a59cba7 100644 --- a/Examples/test-suite/overload_template.i +++ b/Examples/test-suite/overload_template.i @@ -1,4 +1,11 @@ %module overload_template + +%{ +#ifdef max +#undef max +#endif +%} + %inline %{ int foo() { diff --git a/Examples/test-suite/template.i b/Examples/test-suite/template.i index 68a9aadd1..9e79b3e86 100644 --- a/Examples/test-suite/template.i +++ b/Examples/test-suite/template.i @@ -7,6 +7,12 @@ /* Let's just grab the original header file here */ +%{ +#ifdef max +#undef max +#endif +%} + %inline %{ template T max(const T a, const T b) { return a>b ? a : b; } diff --git a/Examples/test-suite/template_explicit.i b/Examples/test-suite/template_explicit.i index 7e39b22c2..bcd8d8126 100644 --- a/Examples/test-suite/template_explicit.i +++ b/Examples/test-suite/template_explicit.i @@ -11,6 +11,11 @@ /* Let's just grab the original header file here */ +%{ +#ifdef max +#undef max +#endif +%} %inline %{ diff --git a/Examples/test-suite/wrapmacro.i b/Examples/test-suite/wrapmacro.i index c9406f9c3..f714fa527 100644 --- a/Examples/test-suite/wrapmacro.i +++ b/Examples/test-suite/wrapmacro.i @@ -2,6 +2,11 @@ /* Testing technique for wrapping macros */ +%{ +#ifdef max +#undef max +#endif +%} /* Here, some macros to wrap */ %inline %{