[Gc] [PATCH] new_gc_alloc.h

Andrew Begel abegel@eecs.berkeley.edu
Wed, 12 Nov 2003 14:19:46 -0800


new_gc_alloc.h uses _T for one of its template parameters. On OSX, this 
conflicts with a definition from /usr/include/ctype.h. Changing _T to 
_Tp fixes the problem and I'm pretty sure shouldn't break any other 
platforms.
Attached is a patch for gc6.3alpha2.

Andy (apologies for line wrapping. Alternate instructions for the 
patch: search for _T and replace with _Tp in include/new_gc_alloc.h).


--- include/new_gc_alloc.h      Fri Jul 26 20:56:04 2002
+++ ../gc6.3alpha2-andy/include/new_gc_alloc.h  Wed Nov 12 13:01:50 2003
@@ -393,12 +393,12 @@

  __STL_BEGIN_NAMESPACE

-template <class _T>
-struct _Alloc_traits<_T, gc_alloc >
+template <class _Tp>
+struct _Alloc_traits<_Tp, gc_alloc >
  {
    static const bool _S_instanceless = true;
-  typedef simple_alloc<_T, gc_alloc > _Alloc_type;
-  typedef __allocator<_T, gc_alloc > allocator_type;
+  typedef simple_alloc<_Tp, gc_alloc > _Alloc_type;
+  typedef __allocator<_Tp, gc_alloc > allocator_type;
  };

  inline bool operator==(const gc_alloc&,
@@ -413,12 +413,12 @@
    return false;
  }

-template <class _T>
-struct _Alloc_traits<_T, single_client_gc_alloc >
+template <class _Tp>
+struct _Alloc_traits<_Tp, single_client_gc_alloc >
  {
    static const bool _S_instanceless = true;
-  typedef simple_alloc<_T, single_client_gc_alloc > _Alloc_type;
-  typedef __allocator<_T, single_client_gc_alloc > allocator_type;
+  typedef simple_alloc<_Tp, single_client_gc_alloc > _Alloc_type;
+  typedef __allocator<_Tp, single_client_gc_alloc > allocator_type;
  };

  inline bool operator==(const single_client_gc_alloc&,
@@ -433,12 +433,12 @@
    return false;
  }

-template <class _T>
-struct _Alloc_traits<_T, traceable_alloc >
+template <class _Tp>
+struct _Alloc_traits<_Tp, traceable_alloc >
  {
    static const bool _S_instanceless = true;
-  typedef simple_alloc<_T, traceable_alloc > _Alloc_type;
-  typedef __allocator<_T, traceable_alloc > allocator_type;
+  typedef simple_alloc<_Tp, traceable_alloc > _Alloc_type;
+  typedef __allocator<_Tp, traceable_alloc > allocator_type;
  };

  inline bool operator==(const traceable_alloc&,
@@ -453,12 +453,12 @@
    return false;
  }

-template <class _T>
-struct _Alloc_traits<_T, single_client_traceable_alloc >
+template <class _Tp>
+struct _Alloc_traits<_Tp, single_client_traceable_alloc >
  {
    static const bool _S_instanceless = true;
-  typedef simple_alloc<_T, single_client_traceable_alloc > _Alloc_type;
-  typedef __allocator<_T, single_client_traceable_alloc > 
allocator_type;
+  typedef simple_alloc<_Tp, single_client_traceable_alloc > 
_Alloc_type;
+  typedef __allocator<_Tp, single_client_traceable_alloc > 
allocator_type;
  };

  inline bool operator==(const single_client_traceable_alloc&,