This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: BZ#13926: Add __bswap_64 for non-GCC compilers
- From: Roland McGrath <roland at hack dot frob dot com>
- To: Andreas Jaeger <aj at suse dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Wed, 28 Mar 2012 10:32:04 -0700 (PDT)
- Subject: Re: BZ#13926: Add __bswap_64 for non-GCC compilers
- References: <4F732554.4010903@suse.com>
> [BZ #13926]
> * sysdeps/i386/bits/byteswap.h (__bswap_constant_64): Add
> definition for non gcc compilers.
> (__bswap_64): Add implementation for non gcc compilers.
Write these as:
[!__GNUC__] (__bswap_constant_64): New macro for this case.
[!__GNUC__] (__bswap_64): New inline function for this case.
> +#else
> +# define __bswap_constant_64(x) \
> + ((((x) & 0xff00000000000000ul) >> 56) \
> + | (((x) & 0x00ff000000000000ul) >> 40) \
There's an excess space in this line (before 40).
(Same in all the copies.)
> +static __inline unsigned long long int
> +__bswap_64 (unsigned long long int __bsx)
This is consistent with the existing __bswap_16 et al.
But, incidentally all these probably want __attribute__((__unused__))
to avoid warnings. But since __attribute__ will be defined away in
<sys/cdefs.h> under the conditions where this code would be used,
I guess there is actually nothing that can be done.
With the whitespace and the log entries fixed, I think this is fine.
Thanks,
Roland