diff options
author | Nils Wallménius <nils@rockbox.org> | 2010-07-15 22:01:06 +0000 |
---|---|---|
committer | Nils Wallménius <nils@rockbox.org> | 2010-07-15 22:01:06 +0000 |
commit | 6d732a32bc4472a9050b118d0920e936a4bf5408 (patch) | |
tree | 0471f9810a5b901808157b375c163b4692388982 /firmware/export/system.h | |
parent | c272144867f94dc7e99f8333bec5dd052878ecd8 (diff) | |
download | rockbox-6d732a32bc4472a9050b118d0920e936a4bf5408.tar.gz rockbox-6d732a32bc4472a9050b118d0920e936a4bf5408.zip |
Don't duplicate byteswap code. Invent system where NEED_GENERIC_BYTESWAPS is set if the generic functions from system.h are needed.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27440 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export/system.h')
-rw-r--r-- | firmware/export/system.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/firmware/export/system.h b/firmware/export/system.h index ee668c87e4..bbaf5d74df 100644 --- a/firmware/export/system.h +++ b/firmware/export/system.h | |||
@@ -241,9 +241,10 @@ enum { | |||
241 | #include "system-target.h" | 241 | #include "system-target.h" |
242 | #elif defined(HAVE_SDL) /* SDL build */ | 242 | #elif defined(HAVE_SDL) /* SDL build */ |
243 | #include "system-sdl.h" | 243 | #include "system-sdl.h" |
244 | #define NEED_GENERIC_BYTESWAPS | ||
244 | #endif | 245 | #endif |
245 | 246 | ||
246 | #if (CONFIG_PLATFORM & PLATFORM_HOSTED) | 247 | #ifdef NEED_GENERIC_BYTESWAPS |
247 | static inline uint16_t swap16(uint16_t value) | 248 | static inline uint16_t swap16(uint16_t value) |
248 | /* | 249 | /* |
249 | result[15..8] = value[ 7..0]; | 250 | result[15..8] = value[ 7..0]; |
@@ -276,7 +277,7 @@ static inline uint32_t swap_odd_even32(uint32_t value) | |||
276 | return (t >> 8) | ((t ^ value) << 8); | 277 | return (t >> 8) | ((t ^ value) << 8); |
277 | } | 278 | } |
278 | 279 | ||
279 | #endif /* PLATFORM_HOSTED */ | 280 | #endif /* NEED_GENERIC_BYTESWAPS */ |
280 | 281 | ||
281 | #ifndef BIT_N | 282 | #ifndef BIT_N |
282 | #define BIT_N(n) (1U << (n)) | 283 | #define BIT_N(n) (1U << (n)) |