merge endian.h (bug #3867)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/v1-0@6005 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Russell Bryant
2005-06-24 22:12:25 +00:00
parent 5e168ffd67
commit 508b530e39
19 changed files with 19 additions and 141 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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>

1
dns.c
View File

@@ -19,6 +19,7 @@
#include <asterisk/logger.h>
#include <asterisk/channel.h>
#include <asterisk/dns.h>
#include "asterisk/endian.h"
#define MAX_SIZE 4096

View File

@@ -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

View File

@@ -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 */

View File

@@ -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 */

View File

@@ -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 */

View File

@@ -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 */

View File

@@ -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";

View File

@@ -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 */

View File

@@ -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 */

View File

@@ -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 */

View File

@@ -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 */

View File

@@ -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 */

View File

@@ -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 */

View File

@@ -57,4 +57,3 @@
#endif /* __BYTE_ORDER */
#endif /* _ASTERISK_ENDIAN_H */

View File

@@ -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];

12
md5.c
View File

@@ -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