diff options
author | 2016-02-19 22:23:32 -0800 | |
---|---|---|
committer | 2016-02-27 09:05:54 -0800 | |
commit | d8c09b5bebe3873a522e5dee920fba86ed46f9b9 (patch) | |
tree | 019e2b1bf6024b0b27c2221259b057e21873eb15 | |
parent | 6d7c19f5759eac6f9ac8014b4bcdb8cb9b059bb7 (diff) | |
download | paludis-d8c09b5bebe3873a522e5dee920fba86ed46f9b9.tar.gz paludis-d8c09b5bebe3873a522e5dee920fba86ed46f9b9.tar.xz |
clean up custom endian detection
Use compiler provided infrastructure for detecting the endian. This has been
supported in GCC since 4.6.
-rw-r--r-- | configure.ac | 8 | ||||
-rw-r--r-- | paludis/util/byte_swap.hh | 2 | ||||
-rw-r--r-- | paludis/util/elf.cc | 2 | ||||
-rw-r--r-- | paludis/util/whirlpool.cc | 2 |
4 files changed, 3 insertions, 11 deletions
diff --git a/configure.ac b/configure.ac index 7c1fe4f6f..4c480a2ab 100644 --- a/configure.ac +++ b/configure.ac @@ -89,14 +89,6 @@ dnl {{{ make pkg-config work... dumb macro... PKG_PROG_PKG_CONFIG([0.9.0]) dnl }}} -dnl {{{ check for byte order -AC_C_BIGENDIAN -if test "x$ac_cv_c_bigendian" = "xyes"; then - PALUDIS_CXXFLAGS="${PALUDIS_CXXFLAGS} -DPALUDIS_BIG_ENDIAN=1" - PALUDIS_PC_CFLAGS="${PALUDIS_PC_CFLAGS} -DPALUDIS_BIG_ENDIAN=1" -fi -dnl }}} - need_xml_check= need_pcrecpp_check= need_libarchive_check= diff --git a/paludis/util/byte_swap.hh b/paludis/util/byte_swap.hh index 2ba778644..4ba744c57 100644 --- a/paludis/util/byte_swap.hh +++ b/paludis/util/byte_swap.hh @@ -76,7 +76,7 @@ namespace paludis return byte_swap_internals::ByteSwap<sizeof(T_), T_>::swap(x); } -#ifdef PALUDIS_BIG_ENDIAN +#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ template <typename T_> inline T_ from_bigendian(T_ x) diff --git a/paludis/util/elf.cc b/paludis/util/elf.cc index 3508f8f5b..f7a0a6fd8 100644 --- a/paludis/util/elf.cc +++ b/paludis/util/elf.cc @@ -59,7 +59,7 @@ namespace paludis enum { native_byte_order = -#ifdef PALUDIS_BIG_ENDIAN +#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ ELFDATA2MSB #else ELFDATA2LSB diff --git a/paludis/util/whirlpool.cc b/paludis/util/whirlpool.cc index 1481fefc5..bbf4089cd 100644 --- a/paludis/util/whirlpool.cc +++ b/paludis/util/whirlpool.cc @@ -213,7 +213,7 @@ namespace { // GCC isn't clever enough to optimise the big endian version combined with // from_bigendian, so do it manually. -#ifdef PALUDIS_BIG_ENDIAN +#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ return (_a((i - j + 8) % 8) >> ((7 - j) * 8)) & 0xFF; #else return (_a((i - j + 8) % 8) >> ( j * 8)) & 0xFF; |