BZ#13926: Add __bswap_64 for non-GCC compilers

Andreas Jaeger aj@suse.com
Mon Apr 2 19:16:00 GMT 2012


Thanks for all the comments on how to improve my last patch.

IMHO this is the best approach to change the code - make it available 
with __GLIBC_HAVE_LONG_LONG only. GCC will never see this code since 
there it is specially handled before.

Ok to commit once testing on both x86 and x86-64 passes?

Andreas

2012-04-02  Andreas Jaeger  <aj@suse.de>

	[BZ #13926]
	* sysdeps/i386/bits/byteswap.h [!__GNUC__](__bswap_constant_64):
	New macro for this case.
	[!__GNUC__] (__bswap_64): New inline function for this case.
	* sysdeps/x86_64/bits/byteswap.h: Likewise.
	* bits/byteswap.h: Likewise.
	* sysdeps/s390/bits/byteswap.h: [!__GNUC__] (__bswap_64): Use
	ull, guard with __GLIBC_HAVE_LONG_LONG.

	* string/endian.h (htobe64,htole64,be64toh,le64toh): Guard with
	__GLIBC_HAVE_LONG_LONG.

	* string/byteswap.h (bswap_64): Guard with
	__GLIBC_HAVE_LONG_LONG.
	Include <features.h> for __GLIBC_HAVE_LONG_LONG.


-- 
  Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi
   SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
    GF: Jeff Hawn,Jennifer Guild,Felix Imendörffer,HRB16746 (AG Nürnberg)
     GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-__bswap_64-definition-for-non-GCC-compilers.patch
Type: text/x-patch
Size: 8665 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20120402/7b0bbc7b/attachment.bin>


More information about the Libc-alpha mailing list