1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-03 06:04:53 +00:00
freebsd-ports/games/xmoto/files/patch-src-include-xm__hashmap.h
Dmitry Marakasov 82d109bcf5 - Fix build with new libc++
PR:		196652
Submitted by:	dim
2015-01-25 01:41:04 +00:00

29 lines
688 B
C++

--- src/include/xm_hashmap.h.orig 2015-01-12 23:04:54.000000000 +0100
+++ src/include/xm_hashmap.h 2015-01-12 23:07:53.000000000 +0100
@@ -13,13 +13,18 @@
#include <hash_map>
namespace HashNamespace=std;
#endif
-struct hashcmp_str {
- bool operator()(const char* s1, const char* s2) {
- if(s1 == NULL || s2 == NULL) {
- return false;
+
+#ifdef _LIBCPP_VERSION
+namespace __gnu_cxx {
+ template<> struct hash<std::string>
+ : public unary_function<std::string, size_t>
+ {
+ size_t operator()(const std::string& s) const
+ {
+ return hash<const char*>()(s.c_str());
}
- return strcmp(s1, s2) == 0;
- }
-};
+ };
+}
+#endif // _LIBCPP_VERSION
#endif