aboutsummaryrefslogtreecommitdiff
path: root/boehm-gc/test_cpp.cc
diff options
context:
space:
mode:
Diffstat (limited to 'boehm-gc/test_cpp.cc')
-rw-r--r--boehm-gc/test_cpp.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/boehm-gc/test_cpp.cc b/boehm-gc/test_cpp.cc
index 3160b09..0d45077 100644
--- a/boehm-gc/test_cpp.cc
+++ b/boehm-gc/test_cpp.cc
@@ -37,6 +37,12 @@ extern "C" {
#ifdef MSWIN32
# include <windows.h>
#endif
+#ifdef GC_NAME_CONFLICT
+# define USE_GC UseGC
+ struct foo * GC;
+#else
+# define USE_GC GC
+#endif
#define my_assert( e ) \
@@ -214,7 +220,7 @@ int APIENTRY WinMain(
for (i = 0; i < 1000; i++) {
C* c = new C( 2 );
C c1( 2 ); /* stack allocation should work too */
- D* d = ::new (GC, D::CleanUp, (void*) i) D( i );
+ D* d = ::new (USE_GC, D::CleanUp, (void*) i) D( i );
F* f = new F;
if (0 == i % 10) delete c;}
@@ -222,9 +228,9 @@ int APIENTRY WinMain(
drop the references to them immediately, forcing many
collections. */
for (i = 0; i < 1000000; i++) {
- A* a = new (GC) A( i );
+ A* a = new (USE_GC) A( i );
B* b = new B( i );
- b = new (GC) B( i );
+ b = new (USE_GC) B( i );
if (0 == i % 10) {
B::Deleting( 1 );
delete b;