[patch] SWAP compatibility fix
Roman Lechtchinsky
rl@cs.tu-berlin.de
Tue Jul 3 08:49:00 GMT 2001
Hi,
the patch fixes a problem with SWAP on platforms with sizeof(int) > 32 as
suggested by Richard Henderson.
Bootstrapped and regtested on sparc-sun-solaris2.7 with
http://gcc.gnu.org/ml/gcc-patches/2001-06/msg01619.html
and --enable-languages="c,c++,f77,objc" (libjava doesn't compile even
without the patch), together with the next patch I'm about to submit.
Bye
Roman
2001-07-03 Roman Lechtchinsky <rl@cs.tu-berlin.de>
* intl/gettextP.h (SWAP): Change parameter type to unsigned int.
Index: intl/gettextP.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/intl/gettextP.h,v
retrieving revision 1.2
diff -c -3 -p -r1.2 gettextP.h
*** gettextP.h 1999/09/04 15:08:49 1.2
--- gettextP.h 2001/07/03 15:31:11
***************
*** 44,56 ****
# include <byteswap.h>
# define SWAP(i) bswap_32 (i)
#else
! static nls_uint32 SWAP PARAMS ((nls_uint32 i));
static inline nls_uint32
SWAP (i)
! nls_uint32 i;
{
! return (i << 24) | ((i & 0xff00) << 8) | ((i >> 8) & 0xff00) | (i >> 24);
}
#endif
--- 44,57 ----
# include <byteswap.h>
# define SWAP(i) bswap_32 (i)
#else
! static nls_uint32 SWAP PARAMS ((unsigned int i));
static inline nls_uint32
SWAP (i)
! unsigned int i;
{
! nls_uint32 x = (nls_uint32) i;
! return (x << 24) | ((x & 0xff00) << 8) | ((x >> 8) & 0xff00) | (x >> 24);
}
#endif
More information about the Gcc-patches
mailing list