2 * Asterisk -- A telephony toolkit for Linux.
4 * Asterisk internal frame definitions.
6 * Copyright (C) 1999 - 2005, Digium, Inc.
8 * Mark Spencer <markster@digium.com>
10 * This program is free software, distributed under the terms of
11 * the GNU Lesser General Public License. Other components of
12 * Asterisk are distributed under The GNU General Public License
16 #ifndef _ASTERISK_ENDIAN_H
17 #define _ASTERISK_ENDIAN_H
20 * Autodetect system endianess
23 #if defined( __OpenBSD__ )
24 # include <machine/types.h>
25 # include <sys/endian.h>
26 #elif defined( __FreeBSD__ ) || defined( __NetBSD__ )
27 # include <sys/types.h>
28 # include <sys/endian.h>
29 #elif defined( BSD ) && ( BSD >= 199103 ) || defined(__APPLE__)
30 # include <machine/endian.h>
31 #elif defined ( SOLARIS )
32 # include <solaris-compat/compat.h>
33 #elif defined( __GNUC__ ) || defined( __GNU_LIBRARY__ )
35 #if !defined(__APPLE__)
36 # include <byteswap.h>
38 #elif defined( linux )
43 #define BYTE_ORDER __BYTE_ORDER
47 #error Endianess needs to be defined
49 #endif /* _ASTERISK_ENDIAN_H */