From 32242e7e10276157533def1c92c4c720945510fc Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Mon, 9 Feb 2009 21:48:48 +0000 Subject: unify the headers/random defines into porting.h to avoid duplication/rot --- utils/readsoname2.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'utils/readsoname2.c') 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); -- cgit v1.2.3