mirror of
https://github.com/freebsd/freebsd-src
synced 2024-11-05 18:22:52 +00:00
When compiling with '-Wall -pedantic', the byte swapping macros gave the
following warning: warning: ANSI C forbids braced-groups within expressions Adding __extension__ before the statement-expression seems to work right. Submitted by: bde (a *long* time ago)
This commit is contained in:
parent
425b5191a4
commit
bbabe47be8
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=19071
1 changed files with 3 additions and 3 deletions
|
@ -31,7 +31,7 @@
|
|||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)endian.h 7.8 (Berkeley) 4/3/91
|
||||
* $Id: endian.h,v 1.5 1994/09/10 20:03:14 csgr Exp $
|
||||
* $Id: endian.h,v 1.6 1995/02/12 08:31:31 jkh Exp $
|
||||
*/
|
||||
|
||||
#ifndef _MACHINE_ENDIAN_H_
|
||||
|
@ -65,13 +65,13 @@
|
|||
__X; })
|
||||
#if __GNUC__ >= 2
|
||||
#define __byte_swap_long(x) \
|
||||
({ register u_long __X = (x); \
|
||||
__extension__ ({ register u_long __X = (x); \
|
||||
__asm ("xchgb %h1, %b1\n\trorl $16, %1\n\txchgb %h1, %b1" \
|
||||
: "=q" (__X) \
|
||||
: "0" (__X)); \
|
||||
__X; })
|
||||
#define __byte_swap_word(x) \
|
||||
({ register u_short __X = (x); \
|
||||
__extension__ ({ register u_short __X = (x); \
|
||||
__asm ("xchgb %h1, %b1" \
|
||||
: "=q" (__X) \
|
||||
: "0" (__X)); \
|
||||
|
|
Loading…
Reference in a new issue