forked from boostorg/endian
Remove use of Predef in detail/order.hpp
This commit is contained in:
@ -7,7 +7,36 @@
|
|||||||
// http://www.boost.org/LICENSE_1_0.txt
|
// http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
#include <boost/core/scoped_enum.hpp>
|
#include <boost/core/scoped_enum.hpp>
|
||||||
#include <boost/predef/other/endian.h>
|
|
||||||
|
#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
|
||||||
|
|
||||||
|
# define BOOST_ENDIAN_NATIVE_ORDER_INITIALIZER little
|
||||||
|
|
||||||
|
#elif defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
|
||||||
|
|
||||||
|
# define BOOST_ENDIAN_NATIVE_ORDER_INITIALIZER big
|
||||||
|
|
||||||
|
#elif defined(__BYTE_ORDER__) && defined(__ORDER_PDP_ENDIAN__) && __BYTE_ORDER__ == __ORDER_PDP_ENDIAN__
|
||||||
|
|
||||||
|
# error The Boost.Endian library does not support platforms with PDP endianness.
|
||||||
|
|
||||||
|
#elif defined(__LITTLE_ENDIAN__)
|
||||||
|
|
||||||
|
# define BOOST_ENDIAN_NATIVE_ORDER_INITIALIZER little
|
||||||
|
|
||||||
|
#elif defined(__BIG_ENDIAN__)
|
||||||
|
|
||||||
|
# define BOOST_ENDIAN_NATIVE_ORDER_INITIALIZER big
|
||||||
|
|
||||||
|
#elif defined(_MSC_VER)
|
||||||
|
|
||||||
|
# define BOOST_ENDIAN_NATIVE_ORDER_INITIALIZER little
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
# error The Boost.Endian library could not determine the endianness of this platform.
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace boost
|
namespace boost
|
||||||
{
|
{
|
||||||
@ -16,20 +45,15 @@ namespace endian
|
|||||||
|
|
||||||
BOOST_SCOPED_ENUM_START(order)
|
BOOST_SCOPED_ENUM_START(order)
|
||||||
{
|
{
|
||||||
big, little,
|
big,
|
||||||
|
little,
|
||||||
|
native = BOOST_ENDIAN_NATIVE_ORDER_INITIALIZER
|
||||||
|
|
||||||
# if BOOST_ENDIAN_BIG_BYTE
|
|
||||||
|
|
||||||
native = big
|
|
||||||
|
|
||||||
# else
|
|
||||||
|
|
||||||
native = little
|
|
||||||
|
|
||||||
# endif
|
|
||||||
}; BOOST_SCOPED_ENUM_END
|
}; BOOST_SCOPED_ENUM_END
|
||||||
|
|
||||||
} // namespace endian
|
} // namespace endian
|
||||||
} // namespace boost
|
} // namespace boost
|
||||||
|
|
||||||
|
#undef BOOST_ENDIAN_NATIVE_ORDER_INITIALIZER
|
||||||
|
|
||||||
#endif // BOOST_ENDIAN_DETAIL_ORDER_HPP_INCLUDED
|
#endif // BOOST_ENDIAN_DETAIL_ORDER_HPP_INCLUDED
|
||||||
|
Reference in New Issue
Block a user