Skip to content

Commit

Permalink
BOOST_BIG_ENDIAN was deprecated and replaced by BOOST_ENDIAN_BIG_BYTE
Browse files Browse the repository at this point in the history
  • Loading branch information
wojdyr committed Sep 13, 2020
1 parent e5e1544 commit 88c7900
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
2 changes: 0 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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], [],
Expand Down
16 changes: 12 additions & 4 deletions xylib/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,18 @@
#include <cstdio>
#include <cstdlib> // strtol, strtod
#include <limits>
#include <boost/detail/endian.hpp>
#include <boost/version.hpp>
#include <boost/cstdint.hpp>

#if BOOST_VERSION >= 106500
#include <boost/predef/other/endian.h>
#if !BOOST_ENDIAN_LITTLE_BYTE && !BOOST_ENDIAN_BIG_BYTE
# error "Unknown endianness"
#endif
#else
#include <boost/detail/endian.hpp>
#if !defined(BOOST_LITTLE_ENDIAN) && !defined(BOOST_BIG_ENDIAN)
#error "Unknown endianness"
# error "Unknown endianness"
#endif
#endif

using namespace std;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 88c7900

Please sign in to comment.