Ignore:
Timestamp:
Mar 26, 2008, 5:58:22 PM (17 years ago)
Author:
Adam Roben
Message:

Windows build fix after r31324

Written with Darin.

Added HashTable plumbing to support using wchar_t as a key type.

  • wtf/HashFunctions.h:
  • wtf/HashTraits.h: (WTF::):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/wtf/HashTraits.h

    r31325 r31335  
    4848    template<> struct IsInteger<unsigned long long> { static const bool value = true; };
    4949
     50#if !COMPILER(MSVC) || defined(_NATIVE_WCHAR_T_DEFINED)
     51    template<> struct IsInteger<wchar_t>            { static const bool value = true; };
     52#endif
     53
    5054    COMPILE_ASSERT(IsInteger<bool>::value, WTF_IsInteger_bool_true);
    5155    COMPILE_ASSERT(IsInteger<char>::value, WTF_IsInteger_char_true);
     
    6165    COMPILE_ASSERT(IsInteger<unsigned long long>::value, WTF_IsInteger_unsigned_long_long_true);
    6266
     67#if !COMPILER(MSVC) || defined(_NATIVE_WCHAR_T_DEFINED)
     68    COMPILE_ASSERT(IsInteger<wchar_t>::value, WTF_IsInteger_wchar_t_true);
     69#endif
     70
    6371    COMPILE_ASSERT(!IsInteger<char*>::value, WTF_IsInteger_char_pointer_false);
    6472    COMPILE_ASSERT(!IsInteger<const char* >::value, WTF_IsInteger_const_char_pointer_false);
     
    119127    };
    120128   
     129#if !COMPILER(MSVC) || defined(_NATIVE_WCHAR_T_DEFINED)
     130    template<> struct HashTraits<wchar_t> : GenericHashTraits<wchar_t> {
     131        static wchar_t deletedValue() { return static_cast<wchar_t>(-1); }
     132    };
     133#endif
     134
    121135    template<typename T> struct FloatHashTraits {
    122136        typedef T TraitType;
Note: See TracChangeset for help on using the changeset viewer.