diff options
author | Pierre Ossman <ossman@cendio.se> | 2006-02-03 14:39:39 +0000 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2006-02-03 14:39:39 +0000 |
commit | d9bfd5b294f2771d9c41fa100d835067dcc7f718 (patch) | |
tree | 4b9f7afb2d5f617e59c962ab9de4438d32614a44 /polyp/endianmacros.h | |
parent | 5c01c1029fc73016184119ce81bb9ae95b3c1f0f (diff) |
Let's have just one endian conversion macro suite.
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@475 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'polyp/endianmacros.h')
-rw-r--r-- | polyp/endianmacros.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/polyp/endianmacros.h b/polyp/endianmacros.h index 91489cd3..3ab1826a 100644 --- a/polyp/endianmacros.h +++ b/polyp/endianmacros.h @@ -33,6 +33,9 @@ #define INT32_SWAP(x) ( (int32_t) ( ((uint32_t) x >> 24) | ((uint32_t) x << 24) | (((uint32_t) x & 0xFF00) << 8) | ((((uint32_t) x) >> 8) & 0xFF00) ) ) #define UINT32_SWAP(x) ( (uint32_t) ( ((uint32_t) x >> 24) | ((uint32_t) x << 24) | (((uint32_t) x & 0xFF00) << 8) | ((((uint32_t) x) >> 8) & 0xFF00) ) ) +#define MAYBE_INT32_SWAP(c,x) ((c) ? INT32_SWAP(x) : x) +#define MAYBE_UINT32_SWAP(c,x) ((c) ? UINT32_SWAP(x) : x) + #ifdef WORDS_BIGENDIAN #define INT16_FROM_LE(x) INT16_SWAP(x) #define INT16_FROM_BE(x) ((int16_t)(x)) |