diff options
author | Mike Frysinger <vapier@gentoo.org> | 2009-02-09 21:48:48 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2009-02-09 21:48:48 +0000 |
commit | 32242e7e10276157533def1c92c4c720945510fc (patch) | |
tree | a91c4ec4e0a229c959c65d6f41f59c8c29648728 /utils/readsoname2.c | |
parent | 98f6d6a8ebd80e9223a4e213a85fd3d0cf1c4190 (diff) |
unify the headers/random defines into porting.h to avoid duplication/rot
Diffstat (limited to 'utils/readsoname2.c')
-rw-r--r-- | utils/readsoname2.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/utils/readsoname2.c b/utils/readsoname2.c index 6a9f00775..a74b46aa1 100644 --- a/utils/readsoname2.c +++ b/utils/readsoname2.c @@ -35,13 +35,11 @@ char *readsonameXX(char *name, FILE *infile, int expected_type, int *type) if ((char *)(epnt + 1) > (char *)(header + st.st_size)) goto skip; -#if __BYTE_ORDER == __LITTLE_ENDIAN - byteswap = (epnt->e_ident[5] == ELFDATA2MSB) ? 1 : 0; -#elif __BYTE_ORDER == __BIG_ENDIAN - byteswap = (epnt->e_ident[5] == ELFDATA2LSB) ? 1 : 0; -#else -#error Unknown host byte order! -#endif + if (UCLIBC_ENDIAN_HOST == UCLIBC_ENDIAN_LITTLE) + byteswap = (epnt->e_ident[5] == ELFDATA2MSB) ? 1 : 0; + else if (UCLIBC_ENDIAN_HOST == UCLIBC_ENDIAN_BIG) + byteswap = (epnt->e_ident[5] == ELFDATA2LSB) ? 1 : 0; + /* Be very lazy, and only byteswap the stuff we use */ if (byteswap == 1) { epnt->e_phoff = bswap_32(epnt->e_phoff); |