From: Marc Olivier Chouinard Date: Thu, 15 Dec 2011 18:14:29 +0000 (-0500) Subject: FS-3747 --resolve X-Git-Tag: v1.2-rc1~27^2~49 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=acdacfc6c0d4f2b6f87cffd56cd7bd4a6bd36d88;p=thirdparty%2Ffreeswitch.git FS-3747 --resolve --- 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