add macro to disable the extra qualifications in members, which seems to be no standard and not supported in gcc4.1 or so

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@8502 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2006-01-21 08:24:52 +00:00
commit d2087c4df0
2 changed files with 47 additions and 8 deletions

View file

@ -1,6 +1,7 @@
%module class_scope_weird
%inline %{
%inline {
#if !defined(SWIG_NOEXTRA_QUALIFICATION)
class Foo {
public:
Foo::Foo(void)
@ -15,11 +16,28 @@ public:
return x;
}
};
#else
class Foo {
public:
Foo(void)
{
}
Foo(int)
{
}
int bar(int x) {
return x;
}
};
#endif
class Quat;
class matrix4;
class tacka3;
#if !defined(SWIG_NOEXTRA_QUALIFICATION)
class Quat {
public:
Quat::Quat(void){}
@ -27,5 +45,14 @@ public:
Quat::Quat(const tacka3& axis, float angle){}
Quat::Quat(const matrix4& m){}
};
%}
#else
class Quat {
public:
Quat(void){}
Quat(float in_w, float x, float y, float z){}
Quat(const tacka3& axis, float angle){}
Quat(const matrix4& m){}
};
#endif
}

View file

@ -7,7 +7,7 @@
%inline
%{
{
void globalscope(); // forward declaration needed for some compilers
@ -138,7 +138,8 @@
void bas() {}
void baz() {}
#if !defined(SWIG_NOEXTRA_QUALIFICATION)
namespace ns2 {
class Foo {
public:
@ -148,13 +149,24 @@
void Foo::member() { }
};
void bar() {}
void bar() {}
}
#else
namespace ns2 {
class Foo {
public:
Foo() {};
friend void bar();
friend void ns1::baz();
void member() { }
};
void bar() {}
}
#endif
}
%}
}
%template(D_i) D<int>;
%template(D_d) D<double>;