mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 07:35:18 +00:00
Simplify endianness and fix for unaligned reads (bug #3867)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5295 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -22,45 +22,7 @@ extern "C" {
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#ifdef SOLARIS
|
||||
#include "solaris-compat/compat.h"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* 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];
|
||||
|
Reference in New Issue
Block a user