diff options
Diffstat (limited to 'games-engines/openmw/files/openmw-0.24.0/02-libc-fixes-don-t-rely-on-tr1.patch')
-rw-r--r-- | games-engines/openmw/files/openmw-0.24.0/02-libc-fixes-don-t-rely-on-tr1.patch | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/games-engines/openmw/files/openmw-0.24.0/02-libc-fixes-don-t-rely-on-tr1.patch b/games-engines/openmw/files/openmw-0.24.0/02-libc-fixes-don-t-rely-on-tr1.patch new file mode 100644 index 0000000..1ccaf75 --- /dev/null +++ b/games-engines/openmw/files/openmw-0.24.0/02-libc-fixes-don-t-rely-on-tr1.patch @@ -0,0 +1,56 @@ +libc++ fixes: don't rely on tr1 + +From: eroen <eroen@occam.eroen.eu> + +libc++ doesn't ship tr1, but ships unordered_map as it is part of c++11. + +Since this is the only tr1 header used in openmw, add a check for c++11 +unordered_map and fallback to tr1 unordered_map if it's not found. +--- + CMakeLists.txt | 6 ++++++ + components/files/configurationmanager.hpp | 8 +++++++- + 2 files changed, 13 insertions(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b989297..43415c9 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -181,6 +181,12 @@ if (UNIX AND NOT APPLE) + find_package (Threads) + endif() + ++include (CheckIncludeFileCXX) ++check_include_file_cxx(unordered_map HAVE_UNORDERED_MAP) ++if (HAVE_UNORDERED_MAP) ++ add_definitions(-DHAVE_UNORDERED_MAP) ++endif () ++ + + set(BOOST_COMPONENTS system filesystem program_options thread date_time wave) + +diff --git a/components/files/configurationmanager.hpp b/components/files/configurationmanager.hpp +index 9056e79..765f1ce 100644 +--- a/components/files/configurationmanager.hpp ++++ b/components/files/configurationmanager.hpp +@@ -3,6 +3,8 @@ + + #ifdef _WIN32 + #include <boost/tr1/tr1/unordered_map> ++#elif defined HAVE_UNORDERED_MAP ++#include <unordered_map> + #else + #include <tr1/unordered_map> + #endif +@@ -48,7 +50,11 @@ struct ConfigurationManager + typedef Files::FixedPath<> FixedPathType; + + typedef const boost::filesystem::path& (FixedPathType::*path_type_f)() const; +- typedef std::tr1::unordered_map<std::string, path_type_f> TokensMappingContainer; ++ #if defined HAVE_UNORDERED_MAP ++ typedef std::unordered_map<std::string, path_type_f> TokensMappingContainer; ++ #else ++ typedef std::tr1::unordered_map<std::string, path_type_f> TokensMappingContainer; ++ #endif + + void loadConfig(const boost::filesystem::path& path, + boost::program_options::variables_map& variables, |