summaryrefslogtreecommitdiffstats
path: root/firmware/include
diff options
context:
space:
mode:
authorFranklin Wei <git@fwei.tk>2017-01-07 15:29:57 -0500
committerFranklin Wei <git@fwei.tk>2017-01-15 12:37:46 -0500
commited6526404f37fc9e98d299488939787c6db932ba (patch)
tree2da0aaa70d012446bbb712af993693676216e01e /firmware/include
parent793c0411beee072d759799008c419310a31cedd2 (diff)
downloadrockbox-ed6526404f37fc9e98d299488939787c6db932ba.tar.gz
rockbox-ed6526404f37fc9e98d299488939787c6db932ba.tar.bz2
rockbox-ed6526404f37fc9e98d299488939787c6db932ba.zip
Support using swapxx() and bswap_xx() for byteswaps in rbendian.h
- patch suggested by Massa in http://forums.rockbox.org/index.php/topic,51618.msg238760.html#msg238760 Change-Id: Iba93ff53119db00a18d944d52bc8b1c5fe593fc9
Diffstat (limited to 'firmware/include')
-rw-r--r--firmware/include/rbendian.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/firmware/include/rbendian.h b/firmware/include/rbendian.h
index 0c03ce6c09..dbb6d4e822 100644
--- a/firmware/include/rbendian.h
+++ b/firmware/include/rbendian.h
@@ -79,10 +79,18 @@
#define __swap16_os(x) __bswap_16(x)
#define __swap32_os(x) __bswap_32(x)
#define __swap64_os(x) __bswap_64(x)
+#elif defined (bswap_16)
+ #define __swap16_os(x) bswap_16(x)
+ #define __swap32_os(x) bswap_32(x)
+ #define __swap64_os(x) bswap_64(x)
#elif defined (__swap16)
#define __swap16_os(x) __swap16(x)
#define __swap32_os(x) __swap32(x)
#define __swap64_os(x) __swap64(x)
+#elif defined (swap16)
+ #define __swap16_os(x) swap16(x)
+ #define __swap32_os(x) swap32(x)
+ #define __swap64_os(x) swap64(x)
#elif defined (__MINGW32__) || (CONFIG_PLATFORM & PLATFORM_MAEMO)
/* kinda hacky but works */
#define __swap16_os(x) SWAP16_CONST(x)