aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2005-06-24 22:12:25 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2005-06-24 22:12:25 +0000
commit68b35aace458f22f7b69073b95fded42c6c2c1fe (patch)
tree2c2a529dab0d7cf25757374aab678e6ca3474ad1
parentb507b4a2fcacc58c85eb8356f3c2256ed9bd9ac2 (diff)
merge endian.h (bug #3867)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/v1-0@6005 f38db490-d61c-443f-a65b-d21fe96a405b
-rwxr-xr-xaesopt.h19
-rwxr-xr-xchannels/chan_alsa.c2
-rwxr-xr-xchannels/chan_oss.c17
-rwxr-xr-xdns.c1
-rwxr-xr-xformats/format_g726.c6
-rwxr-xr-xformats/format_g729.c6
-rwxr-xr-xformats/format_gsm.c6
-rwxr-xr-xformats/format_h263.c6
-rwxr-xr-xformats/format_ilbc.c6
-rwxr-xr-xformats/format_jpeg.c6
-rwxr-xr-xformats/format_pcm.c6
-rwxr-xr-xformats/format_pcm_alaw.c6
-rwxr-xr-xformats/format_sln.c6
-rwxr-xr-xformats/format_vox.c6
-rwxr-xr-xformats/format_wav.c7
-rwxr-xr-xformats/format_wav_gsm.c6
-rwxr-xr-xinclude/asterisk/endian.h1
-rwxr-xr-xinclude/asterisk/frame.h35
-rwxr-xr-xmd5.c12
19 files changed, 19 insertions, 141 deletions
diff --git a/aesopt.h b/aesopt.h
index 94e3e47f1..d5ae00160 100755
--- a/aesopt.h
+++ b/aesopt.h
@@ -136,6 +136,7 @@
#define _AESOPT_H
#include <asterisk/aes.h>
+#include "asterisk/endian.h"
/* CONFIGURATION - USE OF DEFINES
@@ -146,24 +147,6 @@
#if clauses.
*/
-/* PLATFORM SPECIFIC INCLUDES */
-
-#if defined( __OpenBSD__ )
-# include <machine/types.h>
-# include <sys/endian.h>
-#elif defined( __FreeBSD__ ) || defined( __NetBSD__ )
-# include <sys/types.h>
-# include <sys/endian.h>
-#elif defined( BSD ) && ( BSD >= 199103 ) || defined(__APPLE__)
-# include <machine/endian.h>
-#elif defined( __GNUC__ ) || defined( __GNU_LIBRARY__ )
-# include <endian.h>
-#if !defined(__APPLE__)
-# include <byteswap.h>
-#endif
-#elif defined( linux )
-# include <endian.h>
-#endif
/* BYTE ORDER IN 32-BIT WORDS
diff --git a/channels/chan_alsa.c b/channels/chan_alsa.c
index 3da955a6b..481837949 100755
--- a/channels/chan_alsa.c
+++ b/channels/chan_alsa.c
@@ -27,7 +27,7 @@
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
-#include <endian.h>
+#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 57f00665c..dbfe53f61 100755
--- a/channels/chan_oss.c
+++ b/channels/chan_oss.c
@@ -35,22 +35,7 @@
#include <stdlib.h>
#include <stdio.h>
-#if defined( __OpenBSD__ )
-# include <sys/endian.h>
-#elif defined( __FreeBSD__ ) || defined( __NetBSD__ )
-# include <sys/endian.h>
-#elif defined( BSD ) && ( BSD >= 199103 ) || defined(__APPLE__)
-# include <machine/endian.h>
-#elif defined ( SOLARIS )
-# include <solaris-compat/compat.h>
-#elif defined( __GNUC__ ) || defined( __GNU_LIBRARY__ )
-# include <endian.h>
-#if !defined(__APPLE__)
-# include <byteswap.h>
-#endif
-#elif defined( linux )
-# include <endian.h>
-#endif
+#include "asterisk/endian.h"
#ifdef __linux
#include <linux/soundcard.h>
diff --git a/dns.c b/dns.c
index 349bd2ebd..65a31ac58 100755
--- a/dns.c
+++ b/dns.c
@@ -19,6 +19,7 @@
#include <asterisk/logger.h>
#include <asterisk/channel.h>
#include <asterisk/dns.h>
+#include "asterisk/endian.h"
#define MAX_SIZE 4096
diff --git a/formats/format_g726.c b/formats/format_g726.c
index 9788a28b4..04d3a84df 100755
--- a/formats/format_g726.c
+++ b/formats/format_g726.c
@@ -24,11 +24,7 @@
#include <unistd.h>
#include <errno.h>
#include <string.h>
-#ifdef __linux__
-#include <endian.h>
-#else
-#include <machine/endian.h>
-#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 55b5fcbb9..3d89d64a8 100755
--- a/formats/format_g729.c
+++ b/formats/format_g729.c
@@ -25,11 +25,7 @@
#include <unistd.h>
#include <errno.h>
#include <string.h>
-#ifdef __linux__
-#include <endian.h>
-#else
-#include <machine/endian.h>
-#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 f4b5aa189..575ef59a3 100755
--- a/formats/format_gsm.c
+++ b/formats/format_gsm.c
@@ -25,11 +25,7 @@
#include <unistd.h>
#include <errno.h>
#include <string.h>
-#ifdef __linux__
-#include <endian.h>
-#else
-#include <machine/endian.h>
-#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 1482e5b5d..ee216c31b 100755
--- a/formats/format_h263.c
+++ b/formats/format_h263.c
@@ -25,11 +25,7 @@
#include <unistd.h>
#include <errno.h>
#include <string.h>
-#ifdef __linux__
-#include <endian.h>
-#else
-#include <machine/endian.h>
-#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 61b9d5958..f7cd50ebf 100755
--- a/formats/format_ilbc.c
+++ b/formats/format_ilbc.c
@@ -27,11 +27,7 @@
#include <unistd.h>
#include <errno.h>
#include <string.h>
-#ifdef __linux__
-#include <endian.h>
-#else
-#include <machine/endian.h>
-#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 56c5ef8d8..6a9432567 100755
--- a/formats/format_jpeg.c
+++ b/formats/format_jpeg.c
@@ -27,11 +27,7 @@
#include <unistd.h>
#include <errno.h>
#include <string.h>
-#ifdef __linux__
-#include <endian.h>
-#else
-#include <machine/endian.h>
-#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 a3ad65143..fc7b73001 100755
--- a/formats/format_pcm.c
+++ b/formats/format_pcm.c
@@ -25,11 +25,7 @@
#include <unistd.h>
#include <errno.h>
#include <string.h>
-#ifdef __linux__
-#include <endian.h>
-#else
-#include <machine/endian.h>
-#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 eda446ca4..13eb7c068 100755
--- a/formats/format_pcm_alaw.c
+++ b/formats/format_pcm_alaw.c
@@ -27,11 +27,7 @@
#include <unistd.h>
#include <errno.h>
#include <string.h>
-#ifdef __linux__
-#include <endian.h>
-#else
-#include <machine/endian.h>
-#endif
+#include "asterisk/endian.h"
#define BUF_SIZE 160 /* 160 samples */
diff --git a/formats/format_sln.c b/formats/format_sln.c
index 224054775..94a728565 100755
--- a/formats/format_sln.c
+++ b/formats/format_sln.c
@@ -23,11 +23,7 @@
#include <unistd.h>
#include <errno.h>
#include <string.h>
-#ifdef __linux__
-#include <endian.h>
-#else
-#include <machine/endian.h>
-#endif
+#include "asterisk/endian.h"
#define BUF_SIZE 320 /* 320 samples */
diff --git a/formats/format_vox.c b/formats/format_vox.c
index 1a09dac52..61f329aaa 100755
--- a/formats/format_vox.c
+++ b/formats/format_vox.c
@@ -25,11 +25,7 @@
#include <unistd.h>
#include <errno.h>
#include <string.h>
-#ifdef __linux__
-#include <endian.h>
-#else
-#include <machine/endian.h>
-#endif
+#include "asterisk/endian.h"
#define BUF_SIZE 80 /* 160 samples */
diff --git a/formats/format_wav.c b/formats/format_wav.c
index 0e87f2de9..d0a904be4 100755
--- a/formats/format_wav.c
+++ b/formats/format_wav.c
@@ -25,11 +25,8 @@
#include <unistd.h>
#include <errno.h>
#include <string.h>
-#ifdef __linux__
-#include <endian.h>
-#else
-#include <machine/endian.h>
-#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 ad3e24fc8..6039e7d19 100755
--- a/formats/format_wav_gsm.c
+++ b/formats/format_wav_gsm.c
@@ -25,11 +25,7 @@
#include <unistd.h>
#include <errno.h>
#include <string.h>
-#ifdef __linux__
-#include <endian.h>
-#else
-#include <machine/endian.h>
-#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 f5e20fb07..cef9d7ba9 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 0000f9f83..0716c953d 100755
--- a/include/asterisk/frame.h
+++ b/include/asterisk/frame.h
@@ -23,40 +23,7 @@ extern "C" {
#include <sys/types.h>
#include <sys/time.h>
-/*
- * Autodetect system endianess
- */
-#ifndef __BYTE_ORDER
-#ifdef __linux__
-#include <endian.h>
-#elif defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__)
-#if defined(__OpenBSD__)
-#include <machine/types.h>
-#endif /* __OpenBSD__ */
-#include <machine/endian.h>
-#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 17a00c6fc..ba29ee255 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 <machine/types.h>
-# include <sys/endian.h>
-#elif defined( __FreeBSD__ ) || defined( __NetBSD__ )
-# include <sys/types.h>
-# include <sys/endian.h>
-#elif defined( BSD ) && ( BSD >= 199103 ) || defined(__APPLE__)
-# include <machine/endian.h>
-#else
-# include <endian.h>
-#endif
+#include "asterisk/endian.h"
# if __BYTE_ORDER == __BIG_ENDIAN || BYTE_ORDER == BIG_ENDIAN
# define HIGHFIRST 1
# endif