diff options
author | Brad King <brad.king@kitware.com> | 2011-08-08 12:48:18 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2011-08-08 12:50:07 (GMT) |
commit | 867c3dcd245790553635c7fd8e3faaed6fbc0fb8 (patch) | |
tree | 7423f7b2083a59fc0e5d5abf45557019b226ca83 /Source/kwsys/hash_fun.hxx.in | |
parent | 0e28009184cdb3ff375bc49142726afaa001ddeb (diff) | |
download | CMake-867c3dcd245790553635c7fd8e3faaed6fbc0fb8.zip CMake-867c3dcd245790553635c7fd8e3faaed6fbc0fb8.tar.gz CMake-867c3dcd245790553635c7fd8e3faaed6fbc0fb8.tar.bz2 |
KWSys: Fix using long long and __int64 with hash_(set|map)
Added hash function for types long long and __int64, conditional on
detection by FundamentalType.
Author: Bradley Lowekamp <blowekamp@mail.nih.gov>
Change-Id: Ie273f55cd4387ca3dbbe00b9d96ad4935e456c9e
Diffstat (limited to 'Source/kwsys/hash_fun.hxx.in')
-rw-r--r-- | Source/kwsys/hash_fun.hxx.in | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/Source/kwsys/hash_fun.hxx.in b/Source/kwsys/hash_fun.hxx.in index f21efc5..9a9cf47 100644 --- a/Source/kwsys/hash_fun.hxx.in +++ b/Source/kwsys/hash_fun.hxx.in @@ -38,7 +38,7 @@ #define @KWSYS_NAMESPACE@_hash_fun_hxx #include <@KWSYS_NAMESPACE@/Configure.hxx> - +#include <@KWSYS_NAMESPACE@/FundamentalType.h> #include <@KWSYS_NAMESPACE@/cstddef> // size_t namespace @KWSYS_NAMESPACE@ @@ -110,6 +110,29 @@ struct hash<unsigned long> { size_t operator()(unsigned long __x) const { return __x; } }; +#if @KWSYS_NAMESPACE@_USE_LONG_LONG +@KWSYS_NAMESPACE@_CXX_DEFINE_SPECIALIZATION +struct hash<long long> { + size_t operator()(long long __x) const { return __x; } +}; + +@KWSYS_NAMESPACE@_CXX_DEFINE_SPECIALIZATION +struct hash<unsigned long long> { + size_t operator()(unsigned long long __x) const { return __x; } +}; +#endif + +#if @KWSYS_NAMESPACE@_USE___INT64 +@KWSYS_NAMESPACE@_CXX_DEFINE_SPECIALIZATION +struct hash<__int64> { + size_t operator()(__int64 __x) const { return __x; } +}; +@KWSYS_NAMESPACE@_CXX_DEFINE_SPECIALIZATION +struct hash<unsigned __int64> { + size_t operator()(unsigned __int64 __x) const { return __x; } +}; +#endif + } // namespace @KWSYS_NAMESPACE@ #endif |