Beginning of solaris portability
authorMark Spencer <markster@digium.com>
Tue, 6 May 2003 22:27:46 +0000 (22:27 +0000)
committerMark Spencer <markster@digium.com>
Tue, 6 May 2003 22:27:46 +0000 (22:27 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@968 65c4cc65-6c06-0410-ace0-fbb531ad65f3

include/asterisk/frame.h
mkdep

index e89891b..27ad5ca 100755 (executable)
 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
diff --git a/mkdep b/mkdep
index 05b3aa1..8475cc1 100755 (executable)
--- a/mkdep
+++ b/mkdep
@@ -1,4 +1,4 @@
-#!/bin/sh -
+#!/bin/bash -
 #
 #      $OpenBSD: mkdep.gcc.sh,v 1.8 1998/09/02 06:40:07 deraadt Exp $
 #      $NetBSD: mkdep.gcc.sh,v 1.9 1994/12/23 07:34:59 jtc Exp $