1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-24 21:01:20 +00:00
freebsd-ports/multimedia/kdemultimedia3/files/patch-kmidi-config.h
Andrew Gallatin bbc55d00b8 Fix this so it works on FreeBSD/alpha 4.x:
The existing patch does different things for 5.x so as to use the
standard __bswapSIZE(x) inline for 5.x. and adds i386 centric code
for FreeBSD 4.x.  This change to the patch modifies the 4.x code
so as to just call htonX(x) on alpha where __byte_swap_X don't exist.

Approved by: will
2002-05-22 16:28:43 +00:00

22 lines
714 B
C

--- kmidi/config.h.orig Sun Oct 21 20:07:36 2001
+++ kmidi/config.h Wed May 22 10:37:04 2002
@@ -261,11 +261,16 @@
/* And a better idea would be to attempt the various asm
optimizations ourselves IMO, but hey, this is free */
#if __FreeBSD_version <= 500000
+#if defined (__i386__)
#define XCHG_SHORT(x) __byte_swap_word(x)
#define XCHG_LONG(x) __byte_swap_long(x)
+#else
+ #define XCHG_SHORT(x) htons(x)
+ #define XCHG_LONG(x) htonl(x)
+#endif
#else
- #define XCHG_SHORT(x) __uint8_swap_uint16(x)
- #define XCHG_LONG(x) __uint8_swap_uint32(x)
+ #define XCHG_SHORT(x) __bswap16(x)
+ #define XCHG_LONG(x) __bswap32(x)
#endif
#else
#define XCHG_SHORT(x) ((((x)&0xFF)<<8) | (((x)>>8)&0xFF))