diff options
author | Dmitry Marakasov <amdmi3@FreeBSD.org> | 2019-10-24 14:30:30 +0000 |
---|---|---|
committer | Dmitry Marakasov <amdmi3@FreeBSD.org> | 2019-10-24 14:30:30 +0000 |
commit | 361c2522a3f390754876ccf08f845477f3e6313e (patch) | |
tree | db83c3beeab38ceac4fa641e0d857dd1aeedfbfe /games/xmoto | |
parent | 395f224edf457bc86ceaa2bfda01c1ccf0a6e13d (diff) | |
download | ports-361c2522a3f390754876ccf08f845477f3e6313e.tar.gz ports-361c2522a3f390754876ccf08f845477f3e6313e.zip |
- Add missing USES and dependency on libX11
- Simplify hash_map handling, C++11 way (fixed build on CURRENT)
Notes
Notes:
svn path=/head/; revision=515341
Diffstat (limited to 'games/xmoto')
-rw-r--r-- | games/xmoto/Makefile | 4 | ||||
-rw-r--r-- | games/xmoto/files/patch-src-include-xm__hashmap.h | 43 |
2 files changed, 27 insertions, 20 deletions
diff --git a/games/xmoto/Makefile b/games/xmoto/Makefile index caf172986f41..e5d2f5ec2dcb 100644 --- a/games/xmoto/Makefile +++ b/games/xmoto/Makefile @@ -23,10 +23,12 @@ LIB_DEPENDS= libode.so:devel/ode \ BROKEN_powerpc64= fails to compile: hashtable.h: no match for call to __gnu_cxx::hash GNU_CONFIGURE= yes -USES= compiler:features dos2unix gmake jpeg localbase lua:51 sqlite +USES= compiler:features dos2unix gl gmake gnome jpeg localbase lua:51 sdl sqlite xorg USE_GNOME= libxml2 USE_SDL= sdl mixer ttf net USE_GL= gl glu +USE_CXXSTD= c++11 +USE_XORG= x11 DOS2UNIX_GLOB= *.cpp *.h CPPFLAGS+= -isystem${LUA_INCDIR} diff --git a/games/xmoto/files/patch-src-include-xm__hashmap.h b/games/xmoto/files/patch-src-include-xm__hashmap.h index c6c6977656d8..4696d9b3c8d3 100644 --- a/games/xmoto/files/patch-src-include-xm__hashmap.h +++ b/games/xmoto/files/patch-src-include-xm__hashmap.h @@ -1,28 +1,33 @@ ---- src/include/xm_hashmap.h.orig 2011-10-11 20:18:17 UTC +--- src/include/xm_hashmap.h.orig 2019-10-23 11:51:33 UTC +++ src/include/xm_hashmap.h -@@ -13,13 +13,18 @@ - #include <hash_map> - namespace HashNamespace=std; - #endif +@@ -1,25 +1,11 @@ + #ifndef __XMHASHMAP_H__ + #define __XMHASHMAP_H__ + +-#ifdef __GNUC__ +-#if (__GNUC__ >= 3) +-#include <ext/hash_map> +- namespace HashNamespace=__gnu_cxx; +-#else +-#include <hash_map> +-#define HashNamespace std +-#endif +-#else // #ifdef __GNUC__ +-#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 ++#include <unordered_map> ++ ++namespace HashNamespace { ++ template <class Key, class T, class Hash = std::hash<Key>, class Pred = std::equal_to<Key>, class Allocator = std::allocator< std::pair<const Key, T> >> ++ using hash_map = std::unordered_map<Key, T, Hash, Pred, Allocator>; + }; #endif |