diff options
author | Brad King <brad.king@kitware.com> | 2005-04-13 19:39:03 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2005-04-13 19:39:03 (GMT) |
commit | be1084b5241725095a7e0591eaf593a4606204a1 (patch) | |
tree | cc9f9c5e94b5c22dd4f375d718e3eed75d82afd3 /Source/kwsys/hashtable.hxx.in | |
parent | 551b28d501058c3437b0c8d962e1662ccdbef392 (diff) | |
download | CMake-be1084b5241725095a7e0591eaf593a4606204a1.zip CMake-be1084b5241725095a7e0591eaf593a4606204a1.tar.gz CMake-be1084b5241725095a7e0591eaf593a4606204a1.tar.bz2 |
COMP: Added KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT check for non-standard argument to stl allocator<>::max_size method. Needed for kwsys hashtable to compile on Sun CC.
Diffstat (limited to 'Source/kwsys/hashtable.hxx.in')
-rw-r--r-- | Source/kwsys/hashtable.hxx.in | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Source/kwsys/hashtable.hxx.in b/Source/kwsys/hashtable.hxx.in index a8cf6c7..033bcfd 100644 --- a/Source/kwsys/hashtable.hxx.in +++ b/Source/kwsys/hashtable.hxx.in @@ -119,11 +119,18 @@ public: alloc_.deallocate(static_cast<alloc_pointer>(static_cast<void*>(p)), n*chunk()); } } +#if @KWSYS_NAMESPACE@_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT + size_type max_size(size_type s) const throw() + { + return alloc_.max_size(s); + } +#else size_type max_size() const throw() { size_type n = alloc_.max_size() / chunk(); return n>0? n:1; } +#endif void construct(pointer p, const value_type& val) { new (p) value_type(val); } void destroy(pointer p) { (void)p; p->~value_type(); } private: |