From d9bfd5b294f2771d9c41fa100d835067dcc7f718 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Fri, 3 Feb 2006 14:39:39 +0000 Subject: 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 --- polyp/endianmacros.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'polyp/endianmacros.h') 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)) -- cgit