diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-05-06 22:27:46 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-05-06 22:27:46 +0000 |
commit | c6901f2adcaa3d40c148c535a451c7c79f236d58 (patch) | |
tree | f77ff40ae7ce929c5fed987c9183c4dcdaac58eb /include | |
parent | bdb06848ba206bd0ce268049d40a12e7b933a385 (diff) |
Beginning of solaris portability
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@968 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rwxr-xr-x | include/asterisk/frame.h | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/include/asterisk/frame.h b/include/asterisk/frame.h index e89891bb1..27ad5ca5d 100755 --- a/include/asterisk/frame.h +++ b/include/asterisk/frame.h @@ -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 |