mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-09 23:00:07 +00:00
Fix __bswap_64 return type in generic bits/byteswap.h.
This commit is contained in:
parent
c9c253d372
commit
ecd4caf978
@ -1,3 +1,8 @@
|
|||||||
|
2012-11-19 Joseph Myers <joseph@codesourcery.com>
|
||||||
|
|
||||||
|
* bits/byteswap.h: Include <bits/types.h>.
|
||||||
|
(__bswap_64): Use __uint64_t instead of unsigned long long int.
|
||||||
|
|
||||||
2012-11-19 Pino Toscano <toscano.pino@tiscali.it>
|
2012-11-19 Pino Toscano <toscano.pino@tiscali.it>
|
||||||
|
|
||||||
* sysdeps/mach/hurd/ptsname.c (ptsname): Change the type of PEERNAME to
|
* sysdeps/mach/hurd/ptsname.c (ptsname): Change the type of PEERNAME to
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#define _BITS_BYTESWAP_H 1
|
#define _BITS_BYTESWAP_H 1
|
||||||
|
|
||||||
#include <features.h>
|
#include <features.h>
|
||||||
|
#include <bits/types.h>
|
||||||
|
|
||||||
/* Swap bytes in 16 bit value. */
|
/* Swap bytes in 16 bit value. */
|
||||||
#define __bswap_constant_16(x) \
|
#define __bswap_constant_16(x) \
|
||||||
@ -70,15 +71,15 @@ __bswap_32 (unsigned int __bsx)
|
|||||||
| (((x) & 0x00000000000000ffull) << 56)))
|
| (((x) & 0x00000000000000ffull) << 56)))
|
||||||
|
|
||||||
# if __GNUC_PREREQ (4, 2)
|
# if __GNUC_PREREQ (4, 2)
|
||||||
static __inline unsigned long long int
|
static __inline __uint64_t
|
||||||
__bswap_64 (unsigned long long int __bsx)
|
__bswap_64 (__uint64_t __bsx)
|
||||||
{
|
{
|
||||||
return __builtin_bswap64 (__bsx);
|
return __builtin_bswap64 (__bsx);
|
||||||
}
|
}
|
||||||
# else
|
# else
|
||||||
# define __bswap_64(x) \
|
# define __bswap_64(x) \
|
||||||
(__extension__ \
|
(__extension__ \
|
||||||
({ union { __extension__ unsigned long long int __ll; \
|
({ union { __extension__ __uint64_t __ll; \
|
||||||
unsigned int __l[2]; } __w, __r; \
|
unsigned int __l[2]; } __w, __r; \
|
||||||
if (__builtin_constant_p (x)) \
|
if (__builtin_constant_p (x)) \
|
||||||
__r.__ll = __bswap_constant_64 (x); \
|
__r.__ll = __bswap_constant_64 (x); \
|
||||||
@ -101,8 +102,8 @@ __bswap_64 (unsigned long long int __bsx)
|
|||||||
| (((x) & 0x000000000000ff00ull) << 40) \
|
| (((x) & 0x000000000000ff00ull) << 40) \
|
||||||
| (((x) & 0x00000000000000ffull) << 56))
|
| (((x) & 0x00000000000000ffull) << 56))
|
||||||
|
|
||||||
static __inline unsigned long long int
|
static __inline __uint64_t
|
||||||
__bswap_64 (unsigned long long int __bsx)
|
__bswap_64 (__uint64_t __bsx)
|
||||||
{
|
{
|
||||||
return __bswap_constant_64 (__bsx);
|
return __bswap_constant_64 (__bsx);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user