Fix test for gcc-4.1

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9148 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2006-06-05 21:04:35 +00:00
commit df6c795a37
2 changed files with 27 additions and 29 deletions

View file

@ -1,43 +1,34 @@
%module class_scope_weird
%inline {
#if !defined(SWIG_NOEXTRA_QUALIFICATION)
// Use this version with extra qualifiers to test SWIG as some compilers accept this
class Foo {
public:
Foo::Foo(void)
{
}
Foo::Foo(int)
{
}
Foo::Foo(void) {}
Foo::Foo(int) {}
int Foo::bar(int x) {
return x;
}
};
#else
// Remove extra qualifiers for the compiler as some compilers won't compile the extra qaulification (eg gcc-4.1 onwards)
%{
class Foo {
public:
Foo(void)
{
}
Foo(int)
{
}
Foo(void) {}
Foo(int) {}
int bar(int x) {
return x;
}
};
#endif
%}
%inline %{
class Quat;
class matrix4;
class tacka3;
%}
#if !defined(SWIG_NOEXTRA_QUALIFICATION)
// Use this version with extra qualifiers to test SWIG as some compilers accept this
class Quat {
public:
Quat::Quat(void){}
@ -45,7 +36,9 @@ public:
Quat::Quat(const tacka3& axis, float angle){}
Quat::Quat(const matrix4& m){}
};
#else
// Remove extra qualifiers for the compiler as some compilers won't compile the extra qaulification (eg gcc-4.1 onwards)
%{
class Quat {
public:
Quat(void){}
@ -53,6 +46,5 @@ public:
Quat(const tacka3& axis, float angle){}
Quat(const matrix4& m){}
};
#endif
}
%}

View file

@ -138,8 +138,11 @@
void bas() {}
void baz() {}
}
}
#if !defined(SWIG_NOEXTRA_QUALIFICATION)
// Use this version with extra qualifiers to test SWIG as some compilers accept this
namespace ns1 {
namespace ns2 {
class Foo {
public:
@ -151,7 +154,11 @@
};
void bar() {}
}
#else
}
// Remove extra qualifiers for the compiler as some compilers won't compile the extra qaulification (eg gcc-4.1 onwards)
%{
namespace ns1 {
namespace ns2 {
class Foo {
public:
@ -163,10 +170,9 @@
};
void bar() {}
}
#endif
}
}
%}
%template(D_i) D<int>;
%template(D_d) D<double>;