From 36d5b5f2a07193878bc06ddec3069e05758f8f78 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20R=C4=99korajski?= Date: Sat, 22 Sep 2012 23:54:39 +0200 Subject: [PATCH] - fix hash_value() issue in wesnoth - rel 3 --- boost-hash-enum.patch | 40 ++++++++++++++++++++++++++++++++++++++++ boost.spec | 4 +++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 boost-hash-enum.patch diff --git a/boost-hash-enum.patch b/boost-hash-enum.patch new file mode 100644 index 0000000..e00795f --- /dev/null +++ b/boost-hash-enum.patch @@ -0,0 +1,40 @@ +$NetBSD: patch-boost_functional_hash_hash.hpp,v 1.1 2012/08/31 12:20:56 adam Exp $ + +Allow hashing enums. + +--- boost/functional/hash/hash.hpp.orig 2012-07-15 23:28:30.000000000 +0000 ++++ boost/functional/hash/hash.hpp +@@ -15,6 +15,8 @@ + #include + #include + #include ++#include ++#include + + #if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) + #include +@@ -90,6 +92,10 @@ namespace boost + template + typename boost::hash_detail::ulong_numbers::type hash_value(T); + ++ template ++ typename boost::enable_if, std::size_t>::type ++ hash_value(T); ++ + #if !BOOST_WORKAROUND(__DMC__, <= 0x848) + template std::size_t hash_value(T* const&); + #else +@@ -179,6 +185,13 @@ namespace boost + return hash_detail::hash_value_unsigned(v); + } + ++ template ++ typename boost::enable_if, std::size_t>::type ++ hash_value(T v) ++ { ++ return static_cast(v); ++ } ++ + // Implementation by Alberto Barbati and Dave Harris. + #if !BOOST_WORKAROUND(__DMC__, <= 0x848) + template std::size_t hash_value(T* const& v) diff --git a/boost.spec b/boost.spec index 43d9bac..18967aa 100644 --- a/boost.spec +++ b/boost.spec @@ -11,12 +11,13 @@ Summary: The Boost C++ Libraries Summary(pl.UTF-8): Biblioteki C++ "Boost" Name: boost Version: 1.51.0 -Release: 2 +Release: 3 License: Boost Software License and others Group: Libraries Source0: http://downloads.sourceforge.net/boost/%{name}_%{fver}.tar.bz2 # Source0-md5: 4b6bd483b692fd138aef84ed2c8eb679 Patch0: %{name}-link.patch +Patch1: %{name}-hash-enum.patch URL: http://www.boost.org/ BuildRequires: bzip2-devel BuildRequires: expat-devel @@ -365,6 +366,7 @@ Dokumentacja dla biblioteki Boost C++. %prep %setup -q -n %{name}_%{fver} %patch0 -p1 +%patch1 -p0 # - don't know how to pass it through (b)jam -s (no way?) # due to oversophisticated build flags system. -- 2.44.0