g++ 4.5 and earlier do not support unrestricted unions

This commit is contained in:
Peter Dimov
2018-09-11 20:18:13 +03:00
parent 7edf9a030a
commit 2837f3b9c5
2 changed files with 6 additions and 2 deletions

View File

@ -35,6 +35,7 @@
#endif
#include <boost/config.hpp>
#include <boost/config/workaround.hpp>
#include <boost/predef/other/endian.h>
#include <boost/endian/conversion.hpp>
#include <boost/endian/buffers.hpp>
@ -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

View File

@ -35,6 +35,7 @@
#endif
#include <boost/config.hpp>
#include <boost/config/workaround.hpp>
#include <boost/predef/other/endian.h>
#include <boost/endian/conversion.hpp>
#include <boost/type_traits/is_signed.hpp>
@ -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