summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/m68k/bits/byteswap.h
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux/m68k/bits/byteswap.h')
-rw-r--r--libc/sysdeps/linux/m68k/bits/byteswap.h52
1 files changed, 26 insertions, 26 deletions
diff --git a/libc/sysdeps/linux/m68k/bits/byteswap.h b/libc/sysdeps/linux/m68k/bits/byteswap.h
index 41bbe5978..ea6aa964b 100644
--- a/libc/sysdeps/linux/m68k/bits/byteswap.h
+++ b/libc/sysdeps/linux/m68k/bits/byteswap.h
@@ -3,19 +3,19 @@
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
+ Lesser General Public License for more details.
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
#if !defined _BYTESWAP_H && !defined _NETINET_IN_H
# error "Never use <bits/byteswap.h> directly; include <byteswap.h> instead."
@@ -34,17 +34,17 @@
#if defined __GNUC__ && __GNUC__ >= 2
# define __bswap_32(x) \
- __extension__ \
- ({ unsigned int __v; \
- if (__builtin_constant_p (x)) \
- __v = __bswap_constant_32 (x); \
- else \
- __asm__ __volatile__ ("ror%.w %#8, %0;" \
- "swap %0;" \
- "ror%.w %#8, %0" \
- : "=d" (__v) \
- : "0" (x)); \
- __v; })
+ __extension__ \
+ ({ unsigned int __bswap_32_v; \
+ if (__builtin_constant_p (x)) \
+ __bswap_32_v = __bswap_constant_32 (x); \
+ else \
+ __asm__ __volatile__ ("ror%.w %#8, %0;" \
+ "swap %0;" \
+ "ror%.w %#8, %0" \
+ : "=d" (__bswap_32_v) \
+ : "0" ((unsigned int) (x))); \
+ __bswap_32_v; })
#else
# define __bswap_32(x) __bswap_constant_32 (x)
#endif
@@ -52,11 +52,11 @@
#if defined __GNUC__ && __GNUC__ >= 2
/* Swap bytes in 64 bit value. */
# define __bswap_64(x) \
- __extension__ \
- ({ union { unsigned long long int __ll; \
- unsigned long int __l[2]; } __v, __r; \
- __v.__ll = (x); \
- __r.__l[0] = __bswap_32 (__v.__l[1]); \
- __r.__l[1] = __bswap_32 (__v.__l[0]); \
- __r.__ll; })
+ __extension__ \
+ ({ union { unsigned long long int __ll; \
+ unsigned long int __l[2]; } __bswap_64_v, __bswap_64_r; \
+ __bswap_64_v.__ll = (x); \
+ __bswap_64_r.__l[0] = __bswap_32 (__bswap_64_v.__l[1]); \
+ __bswap_64_r.__l[1] = __bswap_32 (__bswap_64_v.__l[0]); \
+ __bswap_64_r.__ll; })
#endif