typedef WX_HASH_MAP_NAMESPACE::hash_map< KEY_T, VALUE_T, HASH_T, KEY_EQ_T > CLASSNAME
#else // !wxUSE_STL || no std::{hash,unordered}_map class available
+
+#define wxNEEDS_WX_HASH_MAP
+
#ifdef __WXWINCE__
typedef int ptrdiff_t;
#else
CLASSEXP CLASSNAME \
{ \
public: \
+ typedef KEY_T first_type; \
+ typedef VALUE_T second_type; \
typedef KEY_T t1; \
typedef VALUE_T t2; \
typedef const KEY_T const_t1; \
return float(items)/float(buckets) >= 0.85;
}
-#endif // !wxUSE_STL || !defined(HAVE_STL_HASH_MAP)
+#endif // various hash map implementations
// ----------------------------------------------------------------------------
// hashing and comparison functors
// operators to suppress warnings about "statement with no effect" from gcc
// in the hash table class assignment operator (where they're assigned)
-#if wxUSE_STL && defined(HAVE_STL_HASH_MAP)
+#ifndef wxNEEDS_WX_HASH_MAP
// integer types
class WXDLLIMPEXP_BASE wxIntegerHash
wxIntegerHash& operator=(const wxIntegerHash&) { return *this; }
};
-#else // !wxUSE_STL || !defined(HAVE_STL_HASH_MAP)
+#else // wxNEEDS_WX_HASH_MAP
// integer types
class WXDLLIMPEXP_BASE wxIntegerHash
wxIntegerHash& operator=(const wxIntegerHash&) { return *this; }
};
-#endif // !wxUSE_STL || !defined(HAVE_STL_HASH_MAP)
+#endif // !wxNEEDS_WX_HASH_MAP/wxNEEDS_WX_HASH_MAP
class WXDLLIMPEXP_BASE wxIntegerEqual
{
public:
wxPointerHash() { }
-#if wxUSE_STL && defined(HAVE_STL_HASH_MAP)
- size_t operator()( const void* k ) const { return (size_t)k; }
-#else
+#ifdef wxNEEDS_WX_HASH_MAP
wxUIntPtr operator()( const void* k ) const { return wxPtrToUInt(k); }
+#else
+ size_t operator()( const void* k ) const { return (size_t)k; }
#endif
wxPointerHash& operator=(const wxPointerHash&) { return *this; }
wxStringEqual& operator=(const wxStringEqual&) { return *this; }
};
-#if !wxUSE_STL || !defined(HAVE_STL_HASH_MAP)
+#ifdef wxNEEDS_WX_HASH_MAP
#define _WX_DECLARE_HASH_MAP( KEY_T, VALUE_T, HASH_T, KEY_EQ_T, CLASSNAME, CLASSEXP ) \
_WX_DECLARE_PAIR( KEY_T, VALUE_T, CLASSNAME##_wxImplementation_Pair, CLASSEXP ) \
} \
}
-#endif // !wxUSE_STL || !defined(HAVE_STL_HASH_MAP)
+#endif // wxNEEDS_WX_HASH_MAP
// these macros are to be used in the user code
#define WX_DECLARE_HASH_MAP( KEY_T, VALUE_T, HASH_T, KEY_EQ_T, CLASSNAME) \