summaryrefslogtreecommitdiff
path: root/include/asterisk/frame.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asterisk/frame.h')
-rwxr-xr-xinclude/asterisk/frame.h22
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