From 8aefcb0452ebfe1f822d7ee1e15fbe5cf23c51d3 Mon Sep 17 00:00:00 2001 From: cxgeorge <> Date: Thu, 1 Nov 2001 02:38:58 +0000 Subject: [PATCH] add unknown_allocator --- dtool/src/dtoolbase/dallocator.h | 10 ++++++---- dtool/src/dtoolbase/dtoolbase.h | 8 ++++++++ dtool/src/dtoolbase/pallocator.h | 10 +++++++--- dtool/src/dtoolbase/pdeque.h | 8 ++++++-- dtool/src/dtoolbase/plist.h | 8 ++++++-- dtool/src/dtoolbase/pmap.h | 7 ++++++- dtool/src/dtoolbase/pset.h | 7 ++++++- dtool/src/dtoolbase/pvector.h | 7 ++++++- 8 files changed, 51 insertions(+), 14 deletions(-) diff --git a/dtool/src/dtoolbase/dallocator.h b/dtool/src/dtoolbase/dallocator.h index faef10b27c..76c9149e2a 100644 --- a/dtool/src/dtoolbase/dallocator.h +++ b/dtool/src/dtoolbase/dallocator.h @@ -18,11 +18,10 @@ #ifndef DALLOCATOR_H #define DALLOCATOR_H +#include #include "dtoolbase.h" -#include - //////////////////////////////////////////////////////////////////// // Class : dallocator // Description : This is similar to pallocator, but always uses the @@ -36,7 +35,9 @@ // within the MemoryUsage class itself. //////////////////////////////////////////////////////////////////// -#if defined(OLD_STYLE_ALLOCATOR) +#if defined(UNKNOWN_ALLOCATOR) +#define dallocator allocator +#elif defined(OLD_STYLE_ALLOCATOR) // Early versions of gcc wanted to use its own kind of allocator, // somewhat different from the STL standard. Irix uses this one too. // It might be inherited from an early draft of the STL standard. @@ -80,13 +81,14 @@ class dallocator : public allocator { public: #ifndef NDEBUG INLINE pointer allocate(size_type n, allocator::const_pointer hint = 0); - // INLINE void deallocate(pointer p, size_type n); INLINE void deallocate(void *p, size_type n); #endif // NDEBUG }; #endif // *_STYLE_ALLOCATOR +#if !defined(UNKNOWN_ALLOCATOR) #include "dallocator.T" +#endif #endif diff --git a/dtool/src/dtoolbase/dtoolbase.h b/dtool/src/dtoolbase/dtoolbase.h index 5eec235bf1..00bffa6895 100644 --- a/dtool/src/dtoolbase/dtoolbase.h +++ b/dtool/src/dtoolbase/dtoolbase.h @@ -48,6 +48,14 @@ /* C4244: 'initializing' : conversion from 'double' to 'float', possible loss of data */ #pragma warning (disable : 4244) +/* +#if _MSC_VER < 1300 +#pragma message("VC 6.0") +#else +#pragma message("VC 7.0") +#endif +*/ + #endif /* WIN32_VC */ #include "dtoolsymbols.h" diff --git a/dtool/src/dtoolbase/pallocator.h b/dtool/src/dtoolbase/pallocator.h index d2c4c347b6..4745dbead0 100644 --- a/dtool/src/dtoolbase/pallocator.h +++ b/dtool/src/dtoolbase/pallocator.h @@ -19,9 +19,9 @@ #ifndef PALLOCATOR_H #define PALLOCATOR_H +#include #include "dtoolbase.h" -#include //////////////////////////////////////////////////////////////////// // Class : pallocator @@ -34,7 +34,10 @@ // to use a pallocator. //////////////////////////////////////////////////////////////////// -#if defined(OLD_STYLE_ALLOCATOR) +#if defined(UNKNOWN_ALLOCATOR) +#define pallocator allocator + +#elif defined(OLD_STYLE_ALLOCATOR) // Early versions of gcc wanted to use its own kind of allocator, // somewhat different from the STL standard. Irix uses this one too. // It might be inherited from an early draft of the STL standard. @@ -78,13 +81,14 @@ class pallocator : public allocator { public: #ifndef NDEBUG INLINE pointer allocate(size_type n, allocator::const_pointer hint = 0); - // INLINE void deallocate(pointer p, size_type n); INLINE void deallocate(void *p, size_type n); #endif // NDEBUG }; #endif // *_STYLE_ALLOCATOR +#if !defined(UNKNOWN_ALLOCATOR) #include "pallocator.T" +#endif #endif diff --git a/dtool/src/dtoolbase/pdeque.h b/dtool/src/dtoolbase/pdeque.h index 05a2520b62..e129bab9cd 100644 --- a/dtool/src/dtoolbase/pdeque.h +++ b/dtool/src/dtoolbase/pdeque.h @@ -21,9 +21,13 @@ #include "dtoolbase.h" #include "pallocator.h" - #include +#ifdef UNKNOWN_ALLOCATOR +#define pdeque deque + +#else + //////////////////////////////////////////////////////////////////// // Class : pdeque // Description : This is our own Panda specialization on the default @@ -41,4 +45,4 @@ public: }; #endif - +#endif diff --git a/dtool/src/dtoolbase/plist.h b/dtool/src/dtoolbase/plist.h index d3ef7a3121..91d4ea2733 100644 --- a/dtool/src/dtoolbase/plist.h +++ b/dtool/src/dtoolbase/plist.h @@ -21,9 +21,13 @@ #include "dtoolbase.h" #include "pallocator.h" - #include +#ifdef UNKNOWN_ALLOCATOR +#define plist list + +#else + //////////////////////////////////////////////////////////////////// // Class : plist // Description : This is our own Panda specialization on the default @@ -47,4 +51,4 @@ public: }; #endif - +#endif diff --git a/dtool/src/dtoolbase/pmap.h b/dtool/src/dtoolbase/pmap.h index 89c77b0e5e..8c9342ff17 100644 --- a/dtool/src/dtoolbase/pmap.h +++ b/dtool/src/dtoolbase/pmap.h @@ -24,6 +24,11 @@ #include +#ifdef UNKNOWN_ALLOCATOR +#define pmap map +#define pmultimap multimap +#else + //////////////////////////////////////////////////////////////////// // Class : pmap // Description : This is our own Panda specialization on the default @@ -55,4 +60,4 @@ public: }; #endif - +#endif diff --git a/dtool/src/dtoolbase/pset.h b/dtool/src/dtoolbase/pset.h index 9c8914d2ba..cbb52fe3c9 100644 --- a/dtool/src/dtoolbase/pset.h +++ b/dtool/src/dtoolbase/pset.h @@ -24,6 +24,11 @@ #include +#ifdef UNKNOWN_ALLOCATOR +#define pset set +#define pmultiset multiset +#else + //////////////////////////////////////////////////////////////////// // Class : pset // Description : This is our own Panda specialization on the default @@ -55,4 +60,4 @@ public: }; #endif - +#endif diff --git a/dtool/src/dtoolbase/pvector.h b/dtool/src/dtoolbase/pvector.h index 0ea2f898f6..8aa9412103 100644 --- a/dtool/src/dtoolbase/pvector.h +++ b/dtool/src/dtoolbase/pvector.h @@ -19,10 +19,14 @@ #ifndef PVECTOR_H #define PVECTOR_H +#include + #include "dtoolbase.h" #include "pallocator.h" -#include +#ifdef UNKNOWN_ALLOCATOR +#define pvector vector +#else //////////////////////////////////////////////////////////////////// // Class : pvector @@ -42,4 +46,5 @@ public: }; #endif +#endif