Version 4.0.2.1, tag libreoffice-4.0.2.1
[LibreOffice.git] / boost / boost.3780.aliasing.patch
blob5ca5ed07ba65eaf67dcdacc3214b96136178449a
1 --- misc/boost_1_44_0/boost/function/function_base.hpp
2 +++ misc/build/boost_1_44_0/boost/function/function_base.hpp
3 @@ -2,6 +2,7 @@
5 // Copyright Douglas Gregor 2001-2006
6 // Copyright Emil Dotchevski 2007
7 +// Copyright Dean Michael Berris 2009
8 // Use, modification and distribution is subject to the Boost Software License, Version 1.0.
9 // (See accompanying file LICENSE_1_0.txt or copy at
10 // http://www.boost.org/LICENSE_1_0.txt)
11 @@ -44,6 +45,13 @@
12 # pragma warning( disable : 4127 ) // "conditional expression is constant"
13 #endif
15 +#if defined(__GNUC__)
16 +// Because GCC complains of strict aliasing problems, we make it
17 +// treat the header as a system header, becoming more forgiving with
18 +// treating implementation details that may be potentially harmful.
19 +# pragma GCC system_header
20 +#endif
22 // Define BOOST_FUNCTION_STD_NS to the namespace that contains type_info.
23 #ifdef BOOST_NO_STD_TYPEINFO
24 // Embedded VC++ does not have type_info in namespace std
25 @@ -314,15 +322,15 @@
27 if (op == clone_functor_tag || op == move_functor_tag) {
28 const functor_type* in_functor =
29 - reinterpret_cast<const functor_type*>(&in_buffer.data);
30 + static_cast<const functor_type*>(static_cast<void*>(&in_buffer.data));
31 new ((void*)&out_buffer.data) functor_type(*in_functor);
33 if (op == move_functor_tag) {
34 - reinterpret_cast<functor_type*>(&in_buffer.data)->~Functor();
35 + static_cast<functor_type*>(static_cast<void*>(&in_buffer.data))->~Functor();
37 } else if (op == destroy_functor_tag) {
38 // Some compilers (Borland, vc6, ...) are unhappy with ~functor_type.
39 - reinterpret_cast<functor_type*>(&out_buffer.data)->~Functor();
40 + static_cast<functor_type*>(static_cast<void*>(&out_buffer.data))->~Functor();
41 } else if (op == check_functor_type_tag) {
42 const detail::sp_typeinfo& check_type
43 = *out_buffer.type.type;