diff --git a/include/boost/endian/arithmetic.hpp b/include/boost/endian/arithmetic.hpp index 6bad70f..38e8bdc 100644 --- a/include/boost/endian/arithmetic.hpp +++ b/include/boost/endian/arithmetic.hpp @@ -35,6 +35,7 @@ #endif #include +#include #include #include #include @@ -58,7 +59,8 @@ # define BOOST_ENDIAN_DEFAULT_CONSTRUCT = default; // C++0x # endif -# if defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS) && defined(BOOST_ENDIAN_FORCE_PODNESS) +// g++ pre-4.6 does not support unrestricted unions, but we have no Config macro for that +# if (defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS) || BOOST_WORKAROUND(BOOST_GCC, < 40600)) && defined(BOOST_ENDIAN_FORCE_PODNESS) # define BOOST_ENDIAN_NO_CTORS # endif diff --git a/include/boost/endian/buffers.hpp b/include/boost/endian/buffers.hpp index dd0e11e..467fd59 100644 --- a/include/boost/endian/buffers.hpp +++ b/include/boost/endian/buffers.hpp @@ -35,6 +35,7 @@ #endif #include +#include #include #include #include @@ -59,7 +60,8 @@ # define BOOST_ENDIAN_DEFAULT_CONSTRUCT = default; // C++0x # endif -# if defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS) && defined(BOOST_ENDIAN_FORCE_PODNESS) +// g++ pre-4.6 does not support unrestricted unions, but we have no Config macro for that +# if (defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS) || BOOST_WORKAROUND(BOOST_GCC, < 40600)) && defined(BOOST_ENDIAN_FORCE_PODNESS) # define BOOST_ENDIAN_NO_CTORS # endif