From: Ivan Maidanski Date: Wed, 28 Dec 2011 10:19:28 +0000 (+0400) Subject: test_cpp: Recognize new macro to choose between GC allocator headers X-Git-Tag: gc7_3alpha2~256 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9672dd818cd355f9bf019d163fb87306665e6980;p=gc test_cpp: Recognize new macro to choose between GC allocator headers * tests/test_cpp.cc (USE_STD_ALLOCATOR): Replace with DONT_USE_STD_ALLOCATOR; remove explicit macro definition; add comment. * tests/test_cpp.cc (main): Use DONT_USE_STD_ALLOCATOR macro instead of USE_STD_ALLOCATOR. --- diff --git a/tests/test_cpp.cc b/tests/test_cpp.cc index fd2982b5..f1393729 100644 --- a/tests/test_cpp.cc +++ b/tests/test_cpp.cc @@ -34,12 +34,11 @@ few minutes to complete. #include #include -#define USE_STD_ALLOCATOR - -#ifdef USE_STD_ALLOCATOR -# include "gc_allocator.h" +#ifndef DONT_USE_STD_ALLOCATOR +# include "gc_allocator.h" #else -# include "new_gc_alloc.h" + /* Note: This works only for ancient STL versions. */ +# include "new_gc_alloc.h" #endif extern "C" { @@ -209,7 +208,7 @@ int APIENTRY WinMain( GC_INIT(); int i, iters, n; -# ifdef USE_STD_ALLOCATOR +# ifndef DONT_USE_STD_ALLOCATOR int *x = gc_allocator().allocate(1); int *xio; xio = gc_allocator_ignore_off_page().allocate(1); @@ -218,7 +217,7 @@ int APIENTRY WinMain( int *x = (int *)gc_alloc::allocate(sizeof(int)); # endif *x = 29; -# ifdef USE_STD_ALLOCATOR +# ifndef DONT_USE_STD_ALLOCATOR *xptr = x; x = 0; # endif @@ -287,7 +286,7 @@ int APIENTRY WinMain( D::Test(); F::Test();} -# ifdef USE_STD_ALLOCATOR +# ifndef DONT_USE_STD_ALLOCATOR x = *xptr; # endif my_assert (29 == x[0]);