diff options
author | Alexander Herz <alexander.herz@mytum.de> | 2012-10-20 16:07:12 +0400 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2012-10-20 16:07:12 +0400 |
commit | 5e360acbb258cbc08a3a3516ba7a206e62c427f9 (patch) | |
tree | 9d64186f736c4deb2723d8e86fa29f1ef283c9bd /tests | |
parent | 2c62153351eac55a28e9baee201cd4aca25d9595 (diff) | |
download | bdwgc-5e360acbb258cbc08a3a3516ba7a206e62c427f9.tar.gz |
Optionally put gc_cpp symbols into 'boehmgc' namespace
* include/gc_cpp.h (GC_NAMESPACE): Recognize new macro.
* include/gc_cpp.h (GC_NS_QUALIFY): New macro definition (prefixing
argument with "boehmgc" namespace if GC_NAMESPACE).
* include/gc_cpp.h (GCPlacement, gc, gc_cleanup, GCCleanUpFunc,
gc::operator new, gc::operator delete, gc::operator new[],
gc::operator delete[], gc_cleanup::~gc_cleanup, gc_cleanup::cleanup):
Put into "boehmgc" namespace if GC_NAMESPACE.
* include/gc_cpp.h (operator new, operator delete, operator new[]):
Wrap GCPlacement, GCCleanUpFunc, UseGC, PointerFreeGC symbols into
GC_NS_QUALIFY.
* tests/test_cpp.cc (USE_GC, main): Wrap UseGC, GC, NoGC symbols into
GC_NS_QUALIFY.
* tests/test_cpp.cc (class B, class C, class D, class E): Wrap gc,
gc_cleanup class names into GC_NS_QUALIFY.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_cpp.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/test_cpp.cc b/tests/test_cpp.cc index 1d47590c..0da985bd 100644 --- a/tests/test_cpp.cc +++ b/tests/test_cpp.cc @@ -58,10 +58,10 @@ extern "C" { #endif #ifdef GC_NAME_CONFLICT -# define USE_GC UseGC +# define USE_GC GC_NS_QUALIFY(UseGC) struct foo * GC; #else -# define USE_GC GC +# define USE_GC GC_NS_QUALIFY(GC) #endif #define my_assert( e ) \ @@ -85,7 +85,7 @@ class A {public: int i;}; -class B: public gc, public A {public: +class B: public GC_NS_QUALIFY(gc), public A { public: /* A collectable class. */ B( int j ): A( j ) {} @@ -98,7 +98,7 @@ class B: public gc, public A {public: int B::deleting = 0; -class C: public gc_cleanup, public A {public: +class C: public GC_NS_QUALIFY(gc_cleanup), public A { public: /* A collectable class with cleanup and virtual multiple inheritance. */ C( int levelArg ): A( levelArg ), level( levelArg ) { @@ -129,7 +129,7 @@ int C::nFreed = 0; int C::nAllocated = 0; -class D: public gc {public: +class D: public GC_NS_QUALIFY(gc) { public: /* A collectable class with a static member function to be used as an explicit clean-up function supplied to ::new. */ @@ -150,7 +150,7 @@ int D::nFreed = 0; int D::nAllocated = 0; -class E: public gc_cleanup {public: +class E: public GC_NS_QUALIFY(gc_cleanup) { public: /* A collectable class with clean-up for use by F. */ E() { @@ -244,8 +244,8 @@ int APIENTRY WinMain( HINSTANCE instance ATTR_UNUSED, GC_word as[ 1000 ]; GC_word bs[ 1000 ]; for (i = 0; i < 1000; i++) { - as[ i ] = Disguise( new (NoGC ) A( i ) ); - bs[ i ] = Disguise( new (NoGC) B( i ) );} + as[ i ] = Disguise( new (GC_NS_QUALIFY(NoGC)) A(i) ); + bs[ i ] = Disguise( new (GC_NS_QUALIFY(NoGC)) B(i) ); } /* Allocate a fair number of finalizable Cs, Ds, and Fs. Later we'll check to make sure they've gone away. */ |