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 %module class_scope_weird
%inline %{ %inline {
#if !defined(SWIG_NOEXTRA_QUALIFICATION)
class Foo { class Foo {
public: public:
Foo::Foo(void) Foo::Foo(void)
@ -15,11 +16,28 @@ public:
return x; return x;
} }
}; };
#else
class Foo {
public:
Foo(void)
{
}
Foo(int)
{
}
int bar(int x) {
return x;
}
};
#endif
class Quat; class Quat;
class matrix4; class matrix4;
class tacka3; class tacka3;
#if !defined(SWIG_NOEXTRA_QUALIFICATION)
class Quat { class Quat {
public: public:
Quat::Quat(void){} Quat::Quat(void){}
@ -27,5 +45,14 @@ 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
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 %inline
%{ {
void globalscope(); // forward declaration needed for some compilers void globalscope(); // forward declaration needed for some compilers
@ -139,6 +139,7 @@
void baz() {} void baz() {}
#if !defined(SWIG_NOEXTRA_QUALIFICATION)
namespace ns2 { namespace ns2 {
class Foo { class Foo {
public: public:
@ -149,12 +150,23 @@
}; };
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_i) D<int>;
%template(D_d) D<double>; %template(D_d) D<double>;