summaryrefslogtreecommitdiff
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
parent793c0411beee072d759799008c419310a31cedd2 (diff)
downloadrockbox-ed6526404f37fc9e98d299488939787c6db932ba.tar.gz
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
-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 @@
79 #define __swap16_os(x) __bswap_16(x) 79 #define __swap16_os(x) __bswap_16(x)
80 #define __swap32_os(x) __bswap_32(x) 80 #define __swap32_os(x) __bswap_32(x)
81 #define __swap64_os(x) __bswap_64(x) 81 #define __swap64_os(x) __bswap_64(x)
82#elif defined (bswap_16)
83 #define __swap16_os(x) bswap_16(x)
84 #define __swap32_os(x) bswap_32(x)
85 #define __swap64_os(x) bswap_64(x)
82#elif defined (__swap16) 86#elif defined (__swap16)
83 #define __swap16_os(x) __swap16(x) 87 #define __swap16_os(x) __swap16(x)
84 #define __swap32_os(x) __swap32(x) 88 #define __swap32_os(x) __swap32(x)
85 #define __swap64_os(x) __swap64(x) 89 #define __swap64_os(x) __swap64(x)
90#elif defined (swap16)
91 #define __swap16_os(x) swap16(x)
92 #define __swap32_os(x) swap32(x)
93 #define __swap64_os(x) swap64(x)
86#elif defined (__MINGW32__) || (CONFIG_PLATFORM & PLATFORM_MAEMO) 94#elif defined (__MINGW32__) || (CONFIG_PLATFORM & PLATFORM_MAEMO)
87 /* kinda hacky but works */ 95 /* kinda hacky but works */
88 #define __swap16_os(x) SWAP16_CONST(x) 96 #define __swap16_os(x) SWAP16_CONST(x)