From acdacfc6c0d4f2b6f87cffd56cd7bd4a6bd36d88 Mon Sep 17 00:00:00 2001 From: Marc Olivier Chouinard Date: Thu, 15 Dec 2011 13:14:29 -0500 Subject: [PATCH] FS-3747 --resolve --- .../mod_spandsp/mod_spandsp_modem.h | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/mod/applications/mod_spandsp/mod_spandsp_modem.h b/src/mod/applications/mod_spandsp/mod_spandsp_modem.h index 6c733625c8..a680deab8a 100644 --- a/src/mod/applications/mod_spandsp/mod_spandsp_modem.h +++ b/src/mod/applications/mod_spandsp/mod_spandsp_modem.h @@ -44,14 +44,41 @@ #include #include + #ifndef WIN32 +#ifdef __APPLE__ +#include +#include +#else #include +#endif #include #endif #include #include #ifndef WIN32 +#if defined(HAVE_BYTESWAP_H) #include +#elif defined(USE_SYS_ENDIAN_H) +#include +#elif defined (__APPLE__) +#include +#define bswap_16 OSSwapInt16 +#define bswap_32 OSSwapInt32 +#define bswap_64 OSSwapInt64 +#else +#define bswap_16(value) \ + ((((value) & 0xff) << 8) | ((value) >> 8)) + +#define bswap_32(value) \ + (((uint32_t)bswap_16((uint16_t)((value) & 0xffff)) << 16) | \ + (uint32_t)bswap_16((uint16_t)((value) >> 16))) + +#define bswap_64(value) \ + (((uint64_t)bswap_32((uint32_t)((value) & 0xffffffff)) \ + << 32) | \ + (uint64_t)bswap_32((uint32_t)((value) >> 32))) +#endif #include #include #endif