GUI: Fix Tomato RAF theme for all builds. Compilation typo.
[tomato.git] / release / src-rt-6.x.4708 / toolchains / hndtools-arm-linux-2.6.36-uclibc-4.5.3 / arm-brcm-linux-uclibcgnueabi / include / c++ / 4.5.3 / backward / hash_fun.h
blobb7b14a1e4188217e8236645ffcbe1942ca2ee22c
1 // 'struct hash' from SGI -*- C++ -*-
3 // Copyright (C) 2001, 2002, 2003, 2004, 2005, 2009, 2010
4 // Free Software Foundation, Inc.
5 //
6 // This file is part of the GNU ISO C++ Library. This library is free
7 // software; you can redistribute it and/or modify it under the
8 // terms of the GNU General Public License as published by the
9 // Free Software Foundation; either version 3, or (at your option)
10 // any later version.
12 // This library is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
17 // Under Section 7 of GPL version 3, you are granted additional
18 // permissions described in the GCC Runtime Library Exception, version
19 // 3.1, as published by the Free Software Foundation.
21 // You should have received a copy of the GNU General Public License and
22 // a copy of the GCC Runtime Library Exception along with this program;
23 // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
24 // <http://www.gnu.org/licenses/>.
27 * Copyright (c) 1996-1998
28 * Silicon Graphics Computer Systems, Inc.
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. Silicon Graphics 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 * Copyright (c) 1994
40 * Hewlett-Packard Company
42 * Permission to use, copy, modify, distribute and sell this software
43 * and its documentation for any purpose is hereby granted without fee,
44 * provided that the above copyright notice appear in all copies and
45 * that both that copyright notice and this permission notice appear
46 * in supporting documentation. Hewlett-Packard Company makes no
47 * representations about the suitability of this software for any
48 * purpose. It is provided "as is" without express or implied warranty.
52 /** @file backward/hash_fun.h
53 * This file is a GNU extension to the Standard C++ Library (possibly
54 * containing extensions from the HP/SGI STL subset).
57 #ifndef _BACKWARD_HASH_FUN_H
58 #define _BACKWARD_HASH_FUN_H 1
60 #include <cstddef>
62 _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
64 using std::size_t;
66 template<class _Key>
67 struct hash { };
69 inline size_t
70 __stl_hash_string(const char* __s)
72 unsigned long __h = 0;
73 for ( ; *__s; ++__s)
74 __h = 5 * __h + *__s;
75 return size_t(__h);
78 template<>
79 struct hash<char*>
81 size_t
82 operator()(const char* __s) const
83 { return __stl_hash_string(__s); }
86 template<>
87 struct hash<const char*>
89 size_t
90 operator()(const char* __s) const
91 { return __stl_hash_string(__s); }
94 template<>
95 struct hash<char>
97 size_t
98 operator()(char __x) const
99 { return __x; }
102 template<>
103 struct hash<unsigned char>
105 size_t
106 operator()(unsigned char __x) const
107 { return __x; }
110 template<>
111 struct hash<signed char>
113 size_t
114 operator()(unsigned char __x) const
115 { return __x; }
118 template<>
119 struct hash<short>
121 size_t
122 operator()(short __x) const
123 { return __x; }
126 template<>
127 struct hash<unsigned short>
129 size_t
130 operator()(unsigned short __x) const
131 { return __x; }
134 template<>
135 struct hash<int>
137 size_t
138 operator()(int __x) const
139 { return __x; }
142 template<>
143 struct hash<unsigned int>
145 size_t
146 operator()(unsigned int __x) const
147 { return __x; }
150 template<>
151 struct hash<long>
153 size_t
154 operator()(long __x) const
155 { return __x; }
158 template<>
159 struct hash<unsigned long>
161 size_t
162 operator()(unsigned long __x) const
163 { return __x; }
166 _GLIBCXX_END_NAMESPACE
168 #endif