diff --git a/configure.ac b/configure.ac index 77e7532..c9479c0 100644 --- a/configure.ac +++ b/configure.ac @@ -68,8 +68,6 @@ AC_CHECK_HEADER([climits], [], [AC_MSG_ERROR([Could not find necessary C++ libs headers])]) AC_CHECK_HEADER([boost/cstdint.hpp], [], [AC_MSG_ERROR([Could not find necessary Boost headers])]) -AC_CHECK_HEADER([boost/detail/endian.hpp], [], - [AC_MSG_ERROR([Could not find necessary Boost headers])]) AC_CHECK_HEADER([boost/spirit/version.hpp], [], [AC_MSG_ERROR([Boost::Spirit headers were not found.])]) AC_CHECK_HEADER([boost/tokenizer.hpp], [], diff --git a/xylib/util.cpp b/xylib/util.cpp index f45af5f..a8e6796 100644 --- a/xylib/util.cpp +++ b/xylib/util.cpp @@ -14,11 +14,18 @@ #include #include // strtol, strtod #include -#include +#include #include - +#if BOOST_VERSION >= 106500 +#include +#if !BOOST_ENDIAN_LITTLE_BYTE && !BOOST_ENDIAN_BIG_BYTE +# error "Unknown endianness" +#endif +#else +#include #if !defined(BOOST_LITTLE_ENDIAN) && !defined(BOOST_BIG_ENDIAN) -#error "Unknown endianness" +# error "Unknown endianness" +#endif #endif using namespace std; @@ -75,7 +82,8 @@ void my_read(istream &f, char *buf, int len) // change the byte-order from "little endian" to host endian // ptr: pointer to the data, size - size in bytes -#if defined(BOOST_BIG_ENDIAN) +#if defined(BOOST_BIG_ENDIAN) || \ + (defined(BOOST_ENDIAN_BIG_BYTE) && BOOST_ENDIAN_BIG_BYTE) void le_to_host(void *ptr, int size) { char *p = (char*) ptr;