From: Russell Bryant Date: Fri, 24 Jun 2005 22:12:25 +0000 (+0000) Subject: merge endian.h (bug #3867) X-Git-Tag: 1.0.11.1~75 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=508b530e39a4c43c685aaca29721af024ec6a297;p=thirdparty%2Fasterisk.git merge endian.h (bug #3867) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/v1-0@6005 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/aesopt.h b/aesopt.h index 94e3e47f15..d5ae001602 100755 --- a/aesopt.h +++ b/aesopt.h @@ -136,6 +136,7 @@ #define _AESOPT_H #include +#include "asterisk/endian.h" /* CONFIGURATION - USE OF DEFINES @@ -146,24 +147,6 @@ #if clauses. */ -/* PLATFORM SPECIFIC INCLUDES */ - -#if defined( __OpenBSD__ ) -# include -# include -#elif defined( __FreeBSD__ ) || defined( __NetBSD__ ) -# include -# include -#elif defined( BSD ) && ( BSD >= 199103 ) || defined(__APPLE__) -# include -#elif defined( __GNUC__ ) || defined( __GNU_LIBRARY__ ) -# include -#if !defined(__APPLE__) -# include -#endif -#elif defined( linux ) -# include -#endif /* BYTE ORDER IN 32-BIT WORDS diff --git a/channels/chan_alsa.c b/channels/chan_alsa.c index 3da955a6bb..481837949d 100755 --- a/channels/chan_alsa.c +++ b/channels/chan_alsa.c @@ -27,7 +27,7 @@ #include #include #include -#include +#include "asterisk/endian.h" #define ALSA_PCM_NEW_HW_PARAMS_API #define ALSA_PCM_NEW_SW_PARAMS_API diff --git a/channels/chan_oss.c b/channels/chan_oss.c index 57f00665cb..dbfe53f617 100755 --- a/channels/chan_oss.c +++ b/channels/chan_oss.c @@ -35,22 +35,7 @@ #include #include -#if defined( __OpenBSD__ ) -# include -#elif defined( __FreeBSD__ ) || defined( __NetBSD__ ) -# include -#elif defined( BSD ) && ( BSD >= 199103 ) || defined(__APPLE__) -# include -#elif defined ( SOLARIS ) -# include -#elif defined( __GNUC__ ) || defined( __GNU_LIBRARY__ ) -# include -#if !defined(__APPLE__) -# include -#endif -#elif defined( linux ) -# include -#endif +#include "asterisk/endian.h" #ifdef __linux #include diff --git a/dns.c b/dns.c index 349bd2ebd7..65a31ac58d 100755 --- a/dns.c +++ b/dns.c @@ -19,6 +19,7 @@ #include #include #include +#include "asterisk/endian.h" #define MAX_SIZE 4096 diff --git a/formats/format_g726.c b/formats/format_g726.c index 9788a28b47..04d3a84df0 100755 --- a/formats/format_g726.c +++ b/formats/format_g726.c @@ -24,11 +24,7 @@ #include #include #include -#ifdef __linux__ -#include -#else -#include -#endif +#include "asterisk/endian.h" #define RATE_40 0 #define RATE_32 1 diff --git a/formats/format_g729.c b/formats/format_g729.c index 55b5fcbb9e..3d89d64a88 100755 --- a/formats/format_g729.c +++ b/formats/format_g729.c @@ -25,11 +25,7 @@ #include #include #include -#ifdef __linux__ -#include -#else -#include -#endif +#include "asterisk/endian.h" /* Some Ideas for this code came from makeg729e.c by Jeffrey Chilton */ diff --git a/formats/format_gsm.c b/formats/format_gsm.c index f4b5aa1894..575ef59a35 100755 --- a/formats/format_gsm.c +++ b/formats/format_gsm.c @@ -25,11 +25,7 @@ #include #include #include -#ifdef __linux__ -#include -#else -#include -#endif +#include "asterisk/endian.h" #include "msgsm.h" /* Some Ideas for this code came from makegsme.c by Jeffrey Chilton */ diff --git a/formats/format_h263.c b/formats/format_h263.c index 1482e5b5d9..ee216c31b2 100755 --- a/formats/format_h263.c +++ b/formats/format_h263.c @@ -25,11 +25,7 @@ #include #include #include -#ifdef __linux__ -#include -#else -#include -#endif +#include "asterisk/endian.h" /* Some Ideas for this code came from makeh263e.c by Jeffrey Chilton */ diff --git a/formats/format_ilbc.c b/formats/format_ilbc.c index 61b9d59586..f7cd50ebff 100755 --- a/formats/format_ilbc.c +++ b/formats/format_ilbc.c @@ -27,11 +27,7 @@ #include #include #include -#ifdef __linux__ -#include -#else -#include -#endif +#include "asterisk/endian.h" /* Some Ideas for this code came from makeg729e.c by Jeffrey Chilton */ diff --git a/formats/format_jpeg.c b/formats/format_jpeg.c index 56c5ef8d80..6a9432567a 100755 --- a/formats/format_jpeg.c +++ b/formats/format_jpeg.c @@ -27,11 +27,7 @@ #include #include #include -#ifdef __linux__ -#include -#else -#include -#endif +#include "asterisk/endian.h" static char *desc = "JPEG (Joint Picture Experts Group) Image Format"; diff --git a/formats/format_pcm.c b/formats/format_pcm.c index a3ad651434..fc7b73001f 100755 --- a/formats/format_pcm.c +++ b/formats/format_pcm.c @@ -25,11 +25,7 @@ #include #include #include -#ifdef __linux__ -#include -#else -#include -#endif +#include "asterisk/endian.h" #define BUF_SIZE 160 /* 160 samples */ diff --git a/formats/format_pcm_alaw.c b/formats/format_pcm_alaw.c index eda446ca42..13eb7c0687 100755 --- a/formats/format_pcm_alaw.c +++ b/formats/format_pcm_alaw.c @@ -27,11 +27,7 @@ #include #include #include -#ifdef __linux__ -#include -#else -#include -#endif +#include "asterisk/endian.h" #define BUF_SIZE 160 /* 160 samples */ diff --git a/formats/format_sln.c b/formats/format_sln.c index 224054775b..94a7285656 100755 --- a/formats/format_sln.c +++ b/formats/format_sln.c @@ -23,11 +23,7 @@ #include #include #include -#ifdef __linux__ -#include -#else -#include -#endif +#include "asterisk/endian.h" #define BUF_SIZE 320 /* 320 samples */ diff --git a/formats/format_vox.c b/formats/format_vox.c index 1a09dac52c..61f329aaa8 100755 --- a/formats/format_vox.c +++ b/formats/format_vox.c @@ -25,11 +25,7 @@ #include #include #include -#ifdef __linux__ -#include -#else -#include -#endif +#include "asterisk/endian.h" #define BUF_SIZE 80 /* 160 samples */ diff --git a/formats/format_wav.c b/formats/format_wav.c index 0e87f2de9a..d0a904be4d 100755 --- a/formats/format_wav.c +++ b/formats/format_wav.c @@ -25,11 +25,8 @@ #include #include #include -#ifdef __linux__ -#include -#else -#include -#endif +#include "asterisk/endian.h" + /* Some Ideas for this code came from makewave.c by Jeffrey Chilton */ diff --git a/formats/format_wav_gsm.c b/formats/format_wav_gsm.c index ad3e24fc85..6039e7d19e 100755 --- a/formats/format_wav_gsm.c +++ b/formats/format_wav_gsm.c @@ -25,11 +25,7 @@ #include #include #include -#ifdef __linux__ -#include -#else -#include -#endif +#include "asterisk/endian.h" #include "msgsm.h" /* Some Ideas for this code came from makewave.c by Jeffrey Chilton */ diff --git a/include/asterisk/endian.h b/include/asterisk/endian.h index f5e20fb07d..cef9d7ba9d 100755 --- a/include/asterisk/endian.h +++ b/include/asterisk/endian.h @@ -57,4 +57,3 @@ #endif /* __BYTE_ORDER */ #endif /* _ASTERISK_ENDIAN_H */ - diff --git a/include/asterisk/frame.h b/include/asterisk/frame.h index 0000f9f838..0716c953df 100755 --- a/include/asterisk/frame.h +++ b/include/asterisk/frame.h @@ -23,40 +23,7 @@ extern "C" { #include #include -/* - * Autodetect system endianess - */ -#ifndef __BYTE_ORDER -#ifdef __linux__ -#include -#elif defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__) -#if defined(__OpenBSD__) -#include -#endif /* __OpenBSD__ */ -#include -#define __BYTE_ORDER BYTE_ORDER -#define __LITTLE_ENDIAN LITTLE_ENDIAN -#define __BIG_ENDIAN BIG_ENDIAN -#else -#ifdef __LITTLE_ENDIAN__ -#define __BYTE_ORDER __LITTLE_ENDIAN -#endif /* __LITTLE_ENDIAN */ - -#if defined(i386) || defined(__i386__) -#define __BYTE_ORDER __LITTLE_ENDIAN -#endif /* defined i386 */ - -#if defined(sun) && defined(unix) && defined(sparc) -#define __BYTE_ORDER __BIG_ENDIAN -#endif /* sun unix sparc */ - -#endif /* linux */ - -#endif /* __BYTE_ORDER */ - -#ifndef __BYTE_ORDER -#error Need to know endianess -#endif /* __BYTE_ORDER */ +#include "asterisk/endian.h" struct ast_codec_pref { char order[32]; diff --git a/md5.c b/md5.c index 17a00c6fcb..ba29ee2559 100755 --- a/md5.c +++ b/md5.c @@ -1,16 +1,6 @@ /* MD5 checksum routines used for authentication. Not covered by GPL, but in the public domain as per the copyright below */ -#if defined( __OpenBSD__ ) -# include -# include -#elif defined( __FreeBSD__ ) || defined( __NetBSD__ ) -# include -# include -#elif defined( BSD ) && ( BSD >= 199103 ) || defined(__APPLE__) -# include -#else -# include -#endif +#include "asterisk/endian.h" # if __BYTE_ORDER == __BIG_ENDIAN || BYTE_ORDER == BIG_ENDIAN # define HIGHFIRST 1 # endif