ソースを参照

build on Windows

David Rose 20 年 前
コミット
b5e0705bfd
2 ファイル変更8 行追加4 行削除
  1. 2 0
      dtool/src/dtoolbase/dallocator.h
  2. 6 4
      dtool/src/dtoolbase/pallocator.h

+ 2 - 0
dtool/src/dtoolbase/dallocator.h

@@ -95,6 +95,7 @@ public:
   INLINE pointer allocate(size_type n, allocator<void>::const_pointer hint = 0);
   INLINE void deallocate(pointer p, size_type n);
 
+#ifdef __GNUC__
   template<class Subtype>
   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<class U> struct rebind { 
     typedef dallocator<U> other; 

+ 6 - 4
dtool/src/dtoolbase/pallocator.h

@@ -104,16 +104,18 @@ public:
   INLINE pointer allocate(size_type n, allocator<void>::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<class Subtype>
-  INLINE void destroy(Subtype *p) {
-    p->~Subtype();
-  }
-  template<class Subtype>
   INLINE void construct(Subtype *p, const Subtype &value) {
     ::new(p) Subtype(value);
   }
+  template<class Subtype>
+  INLINE void destroy(Subtype *p) {
+    p->~Subtype();
+  }
+#endif  // __GNUC__
 
   template<class U> struct rebind { 
     typedef pallocator<U> other;