From d08e6df2202ed3f19b681221b502dedb3c6c8a28 Mon Sep 17 00:00:00 2001 From: borutr Date: Wed, 21 Jan 2009 21:08:10 +0000 Subject: [PATCH] * as/link/lkar.h: sgetl and sputl are independent of endianness * as/link/sdxxxx_config.h.in: removed endianness detection git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@5346 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- ChangeLog | 5 +++++ as/link/asxxxx_config.h.in | 26 -------------------------- as/link/lkar.h | 5 ----- 3 files changed, 5 insertions(+), 31 deletions(-) diff --git a/ChangeLog b/ChangeLog index 66533b04..d910cca2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-01-21 Borut Razem + + * as/link/lkar.h: sgetl and sputl are independent of endianness + * as/link/sdxxxx_config.h.in: removed endianness detection + 2009-01-20 Borut Razem * .version, doc/sdccman.lyx: bumped sdcc version to 2.8.8 diff --git a/as/link/asxxxx_config.h.in b/as/link/asxxxx_config.h.in index 7d2128ed..fb4f91de 100644 --- a/as/link/asxxxx_config.h.in +++ b/as/link/asxxxx_config.h.in @@ -1,32 +1,6 @@ #ifndef __ASXXXX_CONFIG_H #define __ASXXXX_CONFIG_H -/* - * find out the endianess of host machine - * in order to be able to make Mac OS X unified binaries - */ -/* This is tricky since these might be defined with a blank replacement list */ -/* such as on SPARC Solaris. However, configure gets it right, so it's ok */ -/* that (_BIG_ENDIAN+0) is false, even though it is defined. */ -#if (__BIG_ENDIAN__+0) || (_BIG_ENDIAN+0) -/* 1) trust the compiler */ -# define WORDS_BIGENDIAN 1 -#elif __LITTLE_ENDIAN__ -/* do nothing */ -#elif (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN) -/* 2) trust the header files */ -# if BYTE_ORDER == BIG_ENDIAN -# define WORDS_BIGENDIAN 1 -# endif -#else -/* 3) trust the configure; this actually doesn't work for unified Mac OS X binaries :-( */ -# undef BUILD_WORDS_BIGENDIAN -# if (defined BUILD_WORDS_BIGENDIAN && BUILD_WORDS_BIGENDIAN) -# define WORDS_BIGENDIAN 1 -# endif -/* 4) assume that host is a little endian machine */ -#endif - #undef TYPE_BYTE #undef TYPE_WORD #undef TYPE_DWORD diff --git a/as/link/lkar.h b/as/link/lkar.h index 586c1b00..e63dacbe 100644 --- a/as/link/lkar.h +++ b/as/link/lkar.h @@ -30,13 +30,8 @@ typedef short gid_t; typedef _off_t off_t; #endif -#ifdef WORDS_BIGENDIAN -#define sgetl(buf) (((((((unsigned char)(buf)[3] << 8) + (unsigned char)(buf)[2]) << 8) + (unsigned char)(buf)[1]) << 8) + (unsigned char)(buf)[0]) -#define sputl(value, buf) ((buf)[3] = ((value) >> 24, (buf)[2] = (value) >> 16, (buf)[1] = (value) >> 8, (buf)[0] = (value)) -#else #define sgetl(buf) (((((((unsigned char)(buf)[0] << 8) + (unsigned char)(buf)[1]) << 8) + (unsigned char)(buf)[2]) << 8) + (unsigned char)(buf)[3]) #define sputl(value, buf) ((buf)[0] = (value) >> 24, (buf)[1] = (value) >> 16, (buf)[2] = (value) >> 8, (buf)[3] = (value)) -#endif #define ARMAG "!\n" /* magic string */ #define SARMAG (sizeof (ARMAG) - 1) /* length of magic string */ -- 2.30.2