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:
parent
5723482a49
commit
df6c795a37
2 changed files with 27 additions and 29 deletions
|
|
@ -1,43 +1,34 @@
|
||||||
%module class_scope_weird
|
%module class_scope_weird
|
||||||
|
|
||||||
%inline {
|
// Use this version with extra qualifiers to test SWIG as some compilers accept this
|
||||||
#if !defined(SWIG_NOEXTRA_QUALIFICATION)
|
|
||||||
class Foo {
|
class Foo {
|
||||||
public:
|
public:
|
||||||
Foo::Foo(void)
|
Foo::Foo(void) {}
|
||||||
{
|
Foo::Foo(int) {}
|
||||||
}
|
|
||||||
|
|
||||||
Foo::Foo(int)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
int Foo::bar(int x) {
|
int Foo::bar(int x) {
|
||||||
return 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 {
|
class Foo {
|
||||||
public:
|
public:
|
||||||
Foo(void)
|
Foo(void) {}
|
||||||
{
|
Foo(int) {}
|
||||||
}
|
|
||||||
|
|
||||||
Foo(int)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
int bar(int x) {
|
int bar(int x) {
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#endif
|
%}
|
||||||
|
|
||||||
|
%inline %{
|
||||||
class Quat;
|
class Quat;
|
||||||
class matrix4;
|
class matrix4;
|
||||||
class tacka3;
|
class tacka3;
|
||||||
|
%}
|
||||||
|
|
||||||
#if !defined(SWIG_NOEXTRA_QUALIFICATION)
|
// Use this version with extra qualifiers to test SWIG as some compilers accept this
|
||||||
class Quat {
|
class Quat {
|
||||||
public:
|
public:
|
||||||
Quat::Quat(void){}
|
Quat::Quat(void){}
|
||||||
|
|
@ -45,7 +36,9 @@ public:
|
||||||
Quat::Quat(const tacka3& axis, float angle){}
|
Quat::Quat(const tacka3& axis, float angle){}
|
||||||
Quat::Quat(const matrix4& m){}
|
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 {
|
class Quat {
|
||||||
public:
|
public:
|
||||||
Quat(void){}
|
Quat(void){}
|
||||||
|
|
@ -53,6 +46,5 @@ public:
|
||||||
Quat(const tacka3& axis, float angle){}
|
Quat(const tacka3& axis, float angle){}
|
||||||
Quat(const matrix4& m){}
|
Quat(const matrix4& m){}
|
||||||
};
|
};
|
||||||
#endif
|
%}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -138,8 +138,11 @@
|
||||||
void bas() {}
|
void bas() {}
|
||||||
|
|
||||||
void baz() {}
|
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 {
|
namespace ns2 {
|
||||||
class Foo {
|
class Foo {
|
||||||
public:
|
public:
|
||||||
|
|
@ -151,7 +154,11 @@
|
||||||
};
|
};
|
||||||
void bar() {}
|
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 {
|
namespace ns2 {
|
||||||
class Foo {
|
class Foo {
|
||||||
public:
|
public:
|
||||||
|
|
@ -163,10 +170,9 @@
|
||||||
};
|
};
|
||||||
void bar() {}
|
void bar() {}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
%}
|
||||||
|
|
||||||
|
|
||||||
%template(D_i) D<int>;
|
%template(D_i) D<int>;
|
||||||
%template(D_d) D<double>;
|
%template(D_d) D<double>;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue