Beginning of solaris portability

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@968 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Spencer
2003-05-06 22:27:46 +00:00
parent 73c22d0d50
commit 26e0fbbeb5
2 changed files with 21 additions and 3 deletions

View File

@@ -20,11 +20,29 @@
extern "C" {
#endif
/*
* Autodetect system endianess
*/
#ifndef __BYTE_ORDER
#ifdef __linux__
#include <endian.h>
#else
#include <machine/endian.h>
#endif
#ifdef __LITTLE_ENDIAN__
#define __BYTE_ORDER __LITTLE_ENDIAN
#endif /* __LITTLE_ENDIAN */
#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 <sys/types.h>
//! Data structure associated with a single frame of data