Skip to content

Instantly share code, notes, and snippets.

@oliora
Created December 5, 2014 10:17
Show Gist options
  • Save oliora/0299a2aa16c2089aec4a to your computer and use it in GitHub Desktop.
Save oliora/0299a2aa16c2089aec4a to your computer and use it in GitHub Desktop.
Boost 1.55 patches for MSVS2013
From 6252e5f867d6e1bea603aa2a0e24e6e0b861ea9f Mon Sep 17 00:00:00 2001
From: Andrey Upadyshev <andrey.upadyshev@satprofbv.com>
Date: Tue, 18 Nov 2014 18:48:52 +0100
Subject: Log patch: fixes incorrect output of the dump manipulator, when used
on AVX2-enabled CPU (e.g. Intel Haswell).
---
libs/log/src/dump_avx2.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libs/log/src/dump_avx2.cpp b/libs/log/src/dump_avx2.cpp
index 92cacbd..fa1ca3f 100644
--- a/libs/log/src/dump_avx2.cpp
+++ b/libs/log/src/dump_avx2.cpp
@@ -205,7 +205,7 @@ BOOST_FORCEINLINE void dump_data_avx2(const void* data, std::size_t size, std::b
__m256i mm_input = _mm256_load_si256(reinterpret_cast< const __m256i* >(p));
__m256i mm_output1, mm_output2, mm_output3;
dump_pack(mm_char_10_to_a, mm_input, mm_output1, mm_output2, mm_output3);
- store_characters_x3(mm_output1, mm_output2, mm_output3, buf);
+ store_characters_x3(mm_output1, mm_output2, mm_output3, b);
}
_mm256_zeroall(); // need to zero all ymm registers to avoid register spills/restores the compler generates around the function call
--
1.9.0.msysgit.0
From 875c14fcfc319f3d1afc136be8ac77bf10616228 Mon Sep 17 00:00:00 2001
From: Andrey Upadyshev <andrey.upadyshev@satprofbv.com>
Date: Tue, 18 Nov 2014 18:53:11 +0100
Subject: Using has_member_function_callable_with from Boost.Container's
allocator_traits causes a compile error (#9332).
---
.../detail/has_member_function_callable_with.hpp | 11 ++++++++++-
.../test/has_member_function_callable_with.cpp | 18 +++++++++++++-----
2 files changed, 23 insertions(+), 6 deletions(-)
diff --git a/boost/intrusive/detail/has_member_function_callable_with.hpp b/boost/intrusive/detail/has_member_function_callable_with.hpp
index be4a015..5311ed8 100644
--- a/boost/intrusive/detail/has_member_function_callable_with.hpp
+++ b/boost/intrusive/detail/has_member_function_callable_with.hpp
@@ -195,6 +195,8 @@
static const bool value = false;
};
+ #ifdef BOOST_NO_CXX11_DECLTYPE
+
//Special case for 0 args
template< class F
, std::size_t N =
@@ -215,13 +217,20 @@
BOOST_PP_CAT(zeroarg_checker_, BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME)(int);
};
+ #endif //#ifdef BOOST_NO_CXX11_DECLTYPE
+
template<typename Fun>
struct BOOST_PP_CAT(BOOST_PP_CAT(has_member_function_callable_with_, BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME),_impl)
<Fun, true>
{
+ #ifndef BOOST_NO_CXX11_DECLTYPE
+ template<class U, class V = decltype(boost::move_detail::declval<Fun>().BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME()) >
+ static boost_intrusive_has_member_function_callable_with::yes_type Test(Fun*);
+ #else
template<class U>
- static BOOST_PP_CAT(zeroarg_checker_, BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME)
+ static BOOST_PP_CAT(zeroarg_checker_, BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME)
<U> Test(BOOST_PP_CAT(zeroarg_checker_, BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME)<U>*);
+ #endif
template <class U>
static boost_intrusive_has_member_function_callable_with::no_type Test(...);
diff --git a/libs/intrusive/test/has_member_function_callable_with.cpp b/libs/intrusive/test/has_member_function_callable_with.cpp
index 96b822e..0036c3f 100644
--- a/libs/intrusive/test/has_member_function_callable_with.cpp
+++ b/libs/intrusive/test/has_member_function_callable_with.cpp
@@ -68,7 +68,7 @@ class has_member_function_named_func
}}}
-#if !defined(BOOST_CONTAINER_PERFECT_FORWARDING)
+#if !defined(BOOST_INTRUSIVE_PERFECT_FORWARDING)
namespace boost{
namespace intrusive{
@@ -259,7 +259,7 @@ class has_member_function_named_func
}}}
-#else
+#else //#if !defined(BOOST_INTRUSIVE_PERFECT_FORWARDING)
namespace boost{
namespace intrusive{
@@ -283,6 +283,7 @@ class has_member_function_named_func
namespace intrusive{
namespace intrusive_detail{
+ #ifdef BOOST_NO_CXX11_DECLTYPE
template<class F, std::size_t N = sizeof(boost::move_detail::declval<F>().func(), 0)>
struct zeroarg_checker_func
{
@@ -299,12 +300,19 @@ class has_member_function_named_func
zeroarg_checker_func(int);
};
+ #endif //BOOST_NO_CXX11_DECLTYPE
+
template<typename Fun>
struct has_member_function_callable_with_func_impl
<Fun, true>
{
- template<class U>
- static zeroarg_checker_func<U> Test(zeroarg_checker_func<U>*);
+ #ifndef BOOST_NO_CXX11_DECLTYPE
+ template<class U, class V = decltype(boost::move_detail::declval<Fun>().func()) >
+ static boost_intrusive_has_member_function_callable_with::yes_type Test(U*);
+ #else
+ template<class U>
+ static zeroarg_checker_func<U> Test(zeroarg_checker_func<U>*);
+ #endif
template <class U>
static has_member_function_callable_with::no_type Test(...);
@@ -356,7 +364,7 @@ class has_member_function_named_func
}}}
-#endif
+#endif //#if !defined(BOOST_INTRUSIVE_PERFECT_FORWARDING)
struct functor
{
--
1.9.0.msysgit.0
From cec1d09cd00cc449ca7b9d457275c1fcd7de1c78 Mon Sep 17 00:00:00 2001
From: Andrey Upadyshev <andrey.upadyshev@satprofbv.com>
Date: Tue, 18 Nov 2014 18:54:01 +0100
Subject: Thread: ex_scoped_thread compile fails (#9333).
---
boost/thread/scoped_thread.hpp | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/boost/thread/scoped_thread.hpp b/boost/thread/scoped_thread.hpp
index e7a00f6..86189b9 100644
--- a/boost/thread/scoped_thread.hpp
+++ b/boost/thread/scoped_thread.hpp
@@ -47,13 +47,13 @@ namespace boost
*
*/
#if ! defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
- template <class F, class ...Args, typename = typename disable_if<is_same<typename decay<F>::type, thread>, dummy* >::type>
+ template <class F, class ...Args, typename = typename disable_if<is_same<typename decay<F>::type, thread>, void* >::type>
explicit strict_scoped_thread(BOOST_THREAD_FWD_REF(F) f, BOOST_THREAD_FWD_REF(Args)... args) :
t_(boost::forward<F>(f), boost::forward<Args>(args)...) {}
#else
template <class F>
explicit strict_scoped_thread(BOOST_THREAD_FWD_REF(F) f,
- typename disable_if<is_same<typename decay<F>::type, thread>, dummy* >::type=0) :
+ typename disable_if<is_same<typename decay<F>::type, thread>, void* >::type=0) :
t_(boost::forward<F>(f)) {}
template <class F, class A1>
strict_scoped_thread(BOOST_THREAD_FWD_REF(F) f, BOOST_THREAD_FWD_REF(A1) a1) :
@@ -137,13 +137,13 @@ namespace boost
*/
#if ! defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
- template <class F, class ...Args, typename = typename disable_if<is_same<typename decay<F>::type, thread>, dummy* >::type>
+ template <class F, class ...Args, typename = typename disable_if<is_same<typename decay<F>::type, thread>, void* >::type>
explicit scoped_thread(BOOST_THREAD_FWD_REF(F) f, BOOST_THREAD_FWD_REF(Args)... args) :
t_(boost::forward<F>(f), boost::forward<Args>(args)...) {}
#else
template <class F>
explicit scoped_thread(BOOST_THREAD_FWD_REF(F) f,
- typename disable_if<is_same<typename decay<F>::type, thread>, dummy* >::type=0) :
+ typename disable_if<is_same<typename decay<F>::type, thread>, void* >::type=0) :
t_(boost::forward<F>(f)) {}
template <class F, class A1>
scoped_thread(BOOST_THREAD_FWD_REF(F) f, BOOST_THREAD_FWD_REF(A1) a1) :
--
1.9.0.msysgit.0
From 7dc6a1a298b32b941d01b1fd7aabebf0e9b8afd4 Mon Sep 17 00:00:00 2001
From: Andrey Upadyshev <andrey.upadyshev@satprofbv.com>
Date: Tue, 18 Nov 2014 18:57:24 +0100
Subject: decltype N3276 for MSVC12 + compile fix for tests (#9410)
---
boost/config/compiler/visualc.hpp | 2 +-
libs/config/test/no_decltype_n3276_fail.cpp | 2 +-
libs/config/test/no_decltype_n3276_pass.cpp | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/boost/config/compiler/visualc.hpp b/boost/config/compiler/visualc.hpp
index 695fa94..1c0f4f0 100644
--- a/boost/config/compiler/visualc.hpp
+++ b/boost/config/compiler/visualc.hpp
@@ -180,13 +180,13 @@
# define BOOST_NO_CXX11_TRAILING_RESULT_TYPES
# define BOOST_NO_CXX11_VARIADIC_TEMPLATES
# define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
+# define BOOST_NO_CXX11_DECLTYPE_N3276
#endif
// C++11 features not supported by any versions
#define BOOST_NO_CXX11_CHAR16_T
#define BOOST_NO_CXX11_CHAR32_T
#define BOOST_NO_CXX11_CONSTEXPR
-#define BOOST_NO_CXX11_DECLTYPE_N3276
#define BOOST_NO_CXX11_NOEXCEPT
#define BOOST_NO_CXX11_UNICODE_LITERALS
#define BOOST_NO_SFINAE_EXPR
diff --git a/libs/config/test/no_decltype_n3276_fail.cpp b/libs/config/test/no_decltype_n3276_fail.cpp
index 216300c..1c0e6c7 100644
--- a/libs/config/test/no_decltype_n3276_fail.cpp
+++ b/libs/config/test/no_decltype_n3276_fail.cpp
@@ -32,6 +32,6 @@
int main( int, char *[] )
{
- return boost_no_decltype_n3276::test();
+ return boost_no_cxx11_decltype_n3276::test();
}
diff --git a/libs/config/test/no_decltype_n3276_pass.cpp b/libs/config/test/no_decltype_n3276_pass.cpp
index 35427be..e40a56b 100644
--- a/libs/config/test/no_decltype_n3276_pass.cpp
+++ b/libs/config/test/no_decltype_n3276_pass.cpp
@@ -27,11 +27,11 @@
#ifndef BOOST_NO_CXX11_DECLTYPE_N3276
#include "boost_no_decltype_n3276.ipp"
#else
-namespace boost_no_decltype_n3276 = empty_boost;
+namespace boost_no_cxx11_decltype_n3276 = empty_boost;
#endif
int main( int, char *[] )
{
- return boost_no_decltype_n3276::test();
+ return boost_no_cxx11_decltype_n3276::test();
}
--
1.9.0.msysgit.0
From afc115dfbbfef043238a41fa3a7a52a1903576f8 Mon Sep 17 00:00:00 2001
From: Andrey Upadyshev <andrey.upadyshev@satprofbv.com>
Date: Tue, 18 Nov 2014 18:58:29 +0100
Subject: Serialization can't compile because of a missing include.
---
boost/archive/iterators/transform_width.hpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/boost/archive/iterators/transform_width.hpp b/boost/archive/iterators/transform_width.hpp
index 5a5c7b7..8da85ee 100644
--- a/boost/archive/iterators/transform_width.hpp
+++ b/boost/archive/iterators/transform_width.hpp
@@ -29,6 +29,7 @@
#include <boost/iterator/iterator_adaptor.hpp>
#include <boost/iterator/iterator_traits.hpp>
+#include <algorithm>
namespace boost {
namespace archive {
--
1.9.0.msysgit.0
@oliora
Copy link
Author

oliora commented Dec 5, 2014

All official patches required for Boost 1.55 to be compatible with MS Visual Studio 2013.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment