summaryrefslogtreecommitdiff
path: root/test_cpp.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test_cpp.cc')
-rw-r--r--test_cpp.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/test_cpp.cc b/test_cpp.cc
index 3160b098..0d450776 100644
--- a/test_cpp.cc
+++ b/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;