Subject: i386 endian.h broken with -ansi
To: None <current-users@sun-lamp.cs.berkeley.edu>
From: Jan-Hinrich Fessel <oskar@zappa.unna.Ping.DE>
List: current-users
Date: 09/12/1994 08:36:27
Hei out there!
When compiling with -ansi, endian.h is (and thus the host to network order
functons are) broken because of the asm statement, which is not a valid
keyword in GCC -ansi. Attached a unidiff to fix this bugs, at least for me
it works just fine.
Funny that it never occured to anyone, though.
Gruesse
Oskar
==============================================================================
Tragbar ist, was nicht herunterfaellt.
oskar@zappa.unna.ping.de
==============================================================================
--- endian.h- Mon Jul 18 21:10:46 1994
+++ endian.h Mon Sep 12 08:18:44 1994
@@ -70,14 +70,14 @@
#if defined(KERNEL) && !defined(I386_CPU)
#define __byte_swap_long(x) \
({ register unsigned long __x = (x); \
- asm ("bswap %1" \
+ __asm__ ("bswap %1" \
: "=r" (__x) \
: "0" (__x)); \
__x; })
#else
#define __byte_swap_long(x) \
({ register unsigned long __x = (x); \
- asm ("rorw $8, %w1\n\trorl $16, %1\n\trorw $8, %w1" \
+ __asm__ ("rorw $8, %w1\n\trorl $16, %1\n\trorw $8, %w1" \
: "=r" (__x) \
: "0" (__x)); \
__x; })
@@ -85,7 +85,7 @@
#define __byte_swap_word(x) \
({ register unsigned short __x = (x); \
- asm ("rorw $8, %w1" \
+ __asm__ ("rorw $8, %w1" \
: "=r" (__x) \
: "0" (__x)); \
__x; })