CVS resync
[CMakeLuaTailorHgBridge.git] / CMakeLua / Source / kwsys / hash_fun.hxx.in
blob36044b697eea614a4beec0d3e76de48bac361dd3
1 /*=========================================================================
3 Program: KWSys - Kitware System Library
4 Module: $RCSfile: hash_fun.hxx.in,v $
6 Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved.
7 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the above copyright notices for more information.
13 =========================================================================*/
15 * Copyright (c) 1996
16 * Silicon Graphics Computer Systems, Inc.
18 * Permission to use, copy, modify, distribute and sell this software
19 * and its documentation for any purpose is hereby granted without fee,
20 * provided that the above copyright notice appear in all copies and
21 * that both that copyright notice and this permission notice appear
22 * in supporting documentation. Silicon Graphics makes no
23 * representations about the suitability of this software for any
24 * purpose. It is provided "as is" without express or implied warranty.
27 * Copyright (c) 1994
28 * Hewlett-Packard Company
30 * Permission to use, copy, modify, distribute and sell this software
31 * and its documentation for any purpose is hereby granted without fee,
32 * provided that the above copyright notice appear in all copies and
33 * that both that copyright notice and this permission notice appear
34 * in supporting documentation. Hewlett-Packard Company makes no
35 * representations about the suitability of this software for any
36 * purpose. It is provided "as is" without express or implied warranty.
39 #ifndef @KWSYS_NAMESPACE@_hash_fun_hxx
40 #define @KWSYS_NAMESPACE@_hash_fun_hxx
42 #include <@KWSYS_NAMESPACE@/Configure.hxx>
44 #include <@KWSYS_NAMESPACE@/cstddef> // size_t
46 namespace @KWSYS_NAMESPACE@
49 template <class _Key> struct hash { };
51 inline size_t _stl_hash_string(const char* __s)
53 unsigned long __h = 0;
54 for ( ; *__s; ++__s)
55 __h = 5*__h + *__s;
57 return size_t(__h);
60 @KWSYS_NAMESPACE@_CXX_DEFINE_SPECIALIZATION
61 struct hash<char*> {
62 size_t operator()(const char* __s) const { return _stl_hash_string(__s); }
65 @KWSYS_NAMESPACE@_CXX_DEFINE_SPECIALIZATION
66 struct hash<const char*> {
67 size_t operator()(const char* __s) const { return _stl_hash_string(__s); }
70 @KWSYS_NAMESPACE@_CXX_DEFINE_SPECIALIZATION
71 struct hash<char> {
72 size_t operator()(char __x) const { return __x; }
75 @KWSYS_NAMESPACE@_CXX_DEFINE_SPECIALIZATION
76 struct hash<unsigned char> {
77 size_t operator()(unsigned char __x) const { return __x; }
80 @KWSYS_NAMESPACE@_CXX_DEFINE_SPECIALIZATION
81 struct hash<signed char> {
82 size_t operator()(unsigned char __x) const { return __x; }
85 @KWSYS_NAMESPACE@_CXX_DEFINE_SPECIALIZATION
86 struct hash<short> {
87 size_t operator()(short __x) const { return __x; }
90 @KWSYS_NAMESPACE@_CXX_DEFINE_SPECIALIZATION
91 struct hash<unsigned short> {
92 size_t operator()(unsigned short __x) const { return __x; }
95 @KWSYS_NAMESPACE@_CXX_DEFINE_SPECIALIZATION
96 struct hash<int> {
97 size_t operator()(int __x) const { return __x; }
100 @KWSYS_NAMESPACE@_CXX_DEFINE_SPECIALIZATION
101 struct hash<unsigned int> {
102 size_t operator()(unsigned int __x) const { return __x; }
105 @KWSYS_NAMESPACE@_CXX_DEFINE_SPECIALIZATION
106 struct hash<long> {
107 size_t operator()(long __x) const { return __x; }
110 @KWSYS_NAMESPACE@_CXX_DEFINE_SPECIALIZATION
111 struct hash<unsigned long> {
112 size_t operator()(unsigned long __x) const { return __x; }
115 } // namespace @KWSYS_NAMESPACE@
117 #endif