From 91c3d90e8f1205e3087d5ce2c3eeae07893b1c17 Mon Sep 17 00:00:00 2001 From: Joshua Colp Date: Mon, 23 Jul 2007 13:46:57 +0000 Subject: Use autoconf logic to determine byte swapping macro presence. This should now also use other macros if present. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@76523 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/chan_skinny.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'channels/chan_skinny.c') diff --git a/channels/chan_skinny.c b/channels/chan_skinny.c index f646362d7..241629200 100644 --- a/channels/chan_skinny.c +++ b/channels/chan_skinny.c @@ -110,7 +110,25 @@ static char version_id[16] = "P002F202"; #define htolel(x) (x) #define htoles(x) (x) #else -#if defined(SOLARIS) || defined(__Darwin__) || defined(__NetBSD__) || defined(__OpenBSD__) +#ifdef HAVE_BYTESWAP_H +#include +#define letohl(x) bswap_32(x) +#define letohs(x) bswap_16(x) +#define htolel(x) bswap_32(x) +#define htoles(x) bswap_16(x) +#elif HAVE_SYS_ENDIAN_SWAP16 +#include +#define letohl(x) __swap32(x) +#define letohs(x) __swap16(x) +#define htolel(x) __swap32(x) +#define htoles(x) __swap16(x) +#elif HAVE_SYS_ENDIAN_BSWAP16 +#include +#define letohl(x) bswap32(x) +#define letohs(x) bswap16(x) +#define htolel(x) bswap32(x) +#define htoles(x) bswap16(x) +#else #define __bswap_16(x) \ ((((x) & 0xff00) >> 8) | \ (((x) & 0x00ff) << 8)) @@ -119,14 +137,12 @@ static char version_id[16] = "P002F202"; (((x) & 0x00ff0000) >> 8) | \ (((x) & 0x0000ff00) << 8) | \ (((x) & 0x000000ff) << 24)) -#else -#include -#endif #define letohl(x) __bswap_32(x) #define letohs(x) __bswap_16(x) #define htolel(x) __bswap_32(x) #define htoles(x) __bswap_16(x) #endif +#endif /*! Global jitterbuffer configuration - by default, jb is disabled */ static struct ast_jb_conf default_jbconf = -- cgit v1.2.3