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: Jakub Jelinek <jakub at redhat 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 19:05:42 +0200
- Subject: Re: BZ#13926: Add __bswap_64 for non-GCC compilers
- References: <4F732554.4010903@suse.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Mar 28, 2012 at 04:51:00PM +0200, Andreas Jaeger wrote:
> +#else
> +# define __bswap_constant_64(x) \
> + ((((x) & 0xff00000000000000ul) >> 56) \
> + | (((x) & 0x00ff000000000000ul) >> 40) \
> + | (((x) & 0x0000ff0000000000ul) >> 24) \
> + | (((x) & 0x000000ff00000000ul) >> 8) \
> + | (((x) & 0x00000000ff000000ul) << 8) \
> + | (((x) & 0x0000000000ff0000ul) << 24) \
> + | (((x) & 0x000000000000ff00ul) << 40) \
> + | (((x) & 0x00000000000000fful) << 56))
> +
> +static __inline unsigned long long int
> +__bswap_64 (unsigned long long int __bsx)
> +{
> + return __bswap_constant_64 (__bsx);
> +}
How do you know that the non-GCC compiler in question supports
unsigned long long type at all? It is not a standard C89 type...
Why are you using ul rather than ull suffixed constants?
Jakub