diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2011-12-28 14:19:28 +0400 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2011-12-28 14:38:05 +0400 |
commit | 9672dd818cd355f9bf019d163fb87306665e6980 (patch) | |
tree | 8c0c2bdf3f1b9f3f1ee38694108ec87750aaad25 /tests | |
parent | 7efb2bdaa3b7ab55dd281460e6f7271ea23961cf (diff) | |
download | bdwgc-9672dd818cd355f9bf019d163fb87306665e6980.tar.gz |
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.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_cpp.cc | 15 |
1 files changed, 7 insertions, 8 deletions
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 <stdlib.h> #include <string.h> -#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<int>().allocate(1); int *xio; xio = gc_allocator_ignore_off_page<int>().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]); |