Skip to content

Commit fc21b71

Browse files
committed
Linux compile fixes
1 parent 2423115 commit fc21b71

File tree

2 files changed

+146
-0
lines changed

2 files changed

+146
-0
lines changed

Shared/sdk/SharedUtil.HashMap.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,24 @@ struct std::hash<SString>
113113
}
114114
};
115115

116+
#if defined(WIN32)
116117
inline size_t hash_value ( const SString& strString ) // Required for sparsehash
117118
{
118119
std::hash<std::string> hashFunction;
119120
return hashFunction ( strString );
120121
}
122+
#elif defined(__GNUC__) && (__GNUC__ >= 3)
123+
namespace __gnu_cxx
124+
{
125+
template<>
126+
struct hash < SString >
127+
{
128+
size_t operator () ( const SString& strString ) const
129+
{
130+
return __stl_hash_string ( strString );
131+
}
132+
};
133+
}
134+
#endif
121135

122136
#endif // WITH_ALLOC_TRACKING
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
/* src/config.h. Generated from config.h.in by configure. */
2+
/* src/config.h.in. Generated from configure.ac by autoheader. */
3+
4+
/* Namespace for Google classes */
5+
#define GOOGLE_NAMESPACE ::google
6+
7+
/* the location of <hash_fun.h>/<stl_hash_fun.h> */
8+
#define HASH_FUN_H <hash_fun.h>
9+
10+
/* the location of <hash_map> */
11+
#define HASH_MAP_H <ext/hash_map>
12+
13+
/* the namespace of hash_map/hash_set */
14+
#define HASH_NAMESPACE __gnu_cxx
15+
16+
/* the location of <hash_set> */
17+
#define HASH_SET_H <ext/hash_set>
18+
19+
/* Define to 1 if you have the <google/malloc_extension.h> header file. */
20+
/* #undef HAVE_GOOGLE_MALLOC_EXTENSION_H */
21+
22+
/* define if the compiler has hash_map */
23+
#define HAVE_HASH_MAP 1
24+
25+
/* define if the compiler has hash_set */
26+
#define HAVE_HASH_SET 1
27+
28+
/* Define to 1 if you have the <inttypes.h> header file. */
29+
#define HAVE_INTTYPES_H 1
30+
31+
/* Define to 1 if the system has the type `long long'. */
32+
#define HAVE_LONG_LONG 1
33+
34+
/* Define to 1 if you have the `memcpy' function. */
35+
#define HAVE_MEMCPY 1
36+
37+
/* Define to 1 if you have the `memmove' function. */
38+
#define HAVE_MEMMOVE 1
39+
40+
/* Define to 1 if you have the <memory.h> header file. */
41+
#define HAVE_MEMORY_H 1
42+
43+
/* define if the compiler implements namespaces */
44+
#define HAVE_NAMESPACES 1
45+
46+
/* Define if you have POSIX threads libraries and header files. */
47+
/* #undef HAVE_PTHREAD */
48+
49+
/* Define to 1 if you have the <stdint.h> header file. */
50+
#define HAVE_STDINT_H 1
51+
52+
/* Define to 1 if you have the <stdlib.h> header file. */
53+
#define HAVE_STDLIB_H 1
54+
55+
/* Define to 1 if you have the <strings.h> header file. */
56+
#define HAVE_STRINGS_H 1
57+
58+
/* Define to 1 if you have the <string.h> header file. */
59+
#define HAVE_STRING_H 1
60+
61+
/* Define to 1 if you have the <sys/resource.h> header file. */
62+
#define HAVE_SYS_RESOURCE_H 1
63+
64+
/* Define to 1 if you have the <sys/stat.h> header file. */
65+
#define HAVE_SYS_STAT_H 1
66+
67+
/* Define to 1 if you have the <sys/time.h> header file. */
68+
#define HAVE_SYS_TIME_H 1
69+
70+
/* Define to 1 if you have the <sys/types.h> header file. */
71+
#define HAVE_SYS_TYPES_H 1
72+
73+
/* Define to 1 if you have the <sys/utsname.h> header file. */
74+
#define HAVE_SYS_UTSNAME_H 1
75+
76+
/* Define to 1 if the system has the type `uint16_t'. */
77+
#define HAVE_UINT16_T 1
78+
79+
/* Define to 1 if you have the <unistd.h> header file. */
80+
#define HAVE_UNISTD_H 1
81+
82+
/* Define to 1 if the system has the type `u_int16_t'. */
83+
#define HAVE_U_INT16_T 1
84+
85+
/* Define to 1 if the system has the type `__uint16'. */
86+
/* #undef HAVE___UINT16 */
87+
88+
/* Name of package */
89+
#define PACKAGE "sparsehash"
90+
91+
/* Define to the address where bug reports for this package should be sent. */
92+
#define PACKAGE_BUGREPORT "opensource@google.com"
93+
94+
/* Define to the full name of this package. */
95+
#define PACKAGE_NAME "sparsehash"
96+
97+
/* Define to the full name and version of this package. */
98+
#define PACKAGE_STRING "sparsehash 1.4"
99+
100+
/* Define to the one symbol short name of this package. */
101+
#define PACKAGE_TARNAME "sparsehash"
102+
103+
/* Define to the home page for this package. */
104+
#define PACKAGE_URL ""
105+
106+
/* Define to the version of this package. */
107+
#define PACKAGE_VERSION "1.4"
108+
109+
/* Define to necessary symbol if this constant uses a non-standard name on
110+
your system. */
111+
/* #undef PTHREAD_CREATE_JOINABLE */
112+
113+
/* The system-provided hash function including the namespace. */
114+
#define SPARSEHASH_HASH HASH_NAMESPACE::hash
115+
116+
/* The system-provided hash function, in namespace HASH_NAMESPACE. */
117+
#define SPARSEHASH_HASH_NO_NAMESPACE hash
118+
119+
/* Define to 1 if you have the ANSI C header files. */
120+
#define STDC_HEADERS 1
121+
122+
/* the namespace where STL code like vector<> is defined */
123+
#define STL_NAMESPACE std
124+
125+
/* Version number of package */
126+
#define VERSION "1.4"
127+
128+
/* Stops putting the code inside the Google namespace */
129+
#define _END_GOOGLE_NAMESPACE_ }
130+
131+
/* Puts following code inside the Google namespace */
132+
#define _START_GOOGLE_NAMESPACE_ namespace google {

0 commit comments

Comments
 (0)