From b5e0705bfddc0d88950d811573408e0ff2af0d30 Mon Sep 17 00:00:00 2001 From: David Rose Date: Mon, 16 May 2005 23:56:19 +0000 Subject: [PATCH] build on Windows --- dtool/src/dtoolbase/dallocator.h | 2 ++ dtool/src/dtoolbase/pallocator.h | 10 ++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/dtool/src/dtoolbase/dallocator.h b/dtool/src/dtoolbase/dallocator.h index 0db6e7611f..62ac429521 100644 --- a/dtool/src/dtoolbase/dallocator.h +++ b/dtool/src/dtoolbase/dallocator.h @@ -95,6 +95,7 @@ public: INLINE pointer allocate(size_type n, allocator::const_pointer hint = 0); INLINE void deallocate(pointer p, size_type n); +#ifdef __GNUC__ template INLINE void destroy(Subtype *p) { p->~Subtype(); @@ -103,6 +104,7 @@ public: INLINE void construct(Subtype *p, const Subtype &value) { ::new(p) Subtype(value); } +#endif // __GNUC__ template struct rebind { typedef dallocator other; diff --git a/dtool/src/dtoolbase/pallocator.h b/dtool/src/dtoolbase/pallocator.h index fa88adcbb1..a32c3a93a4 100644 --- a/dtool/src/dtoolbase/pallocator.h +++ b/dtool/src/dtoolbase/pallocator.h @@ -104,16 +104,18 @@ public: INLINE pointer allocate(size_type n, allocator::const_pointer hint = 0); INLINE void deallocate(pointer p, size_type n); +#ifdef __GNUC__ // The gcc 4.0 version seems to pass any old type to construct() and // destroy(), so we need template methods. template - INLINE void destroy(Subtype *p) { - p->~Subtype(); - } - template INLINE void construct(Subtype *p, const Subtype &value) { ::new(p) Subtype(value); } + template + INLINE void destroy(Subtype *p) { + p->~Subtype(); + } +#endif // __GNUC__ template struct rebind { typedef pallocator other;