Fix OSS endian issues in OSS (bug #3846)
authorMark Spencer <markster@digium.com>
Thu, 24 Mar 2005 22:01:56 +0000 (22:01 +0000)
committerMark Spencer <markster@digium.com>
Thu, 24 Mar 2005 22:01:56 +0000 (22:01 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5255 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_oss.c

index 316529c..480408e 100755 (executable)
 #include <string.h>
 #include <stdlib.h>
 #include <stdio.h>
-#include <endian.h>
+
+#if defined( __OpenBSD__ )
+#  include <sys/endian.h>
+#elif defined( __FreeBSD__ ) || defined( __NetBSD__ )
+#  include <sys/endian.h>   
+#elif defined( BSD ) && ( BSD >= 199103 ) || defined(__APPLE__)
+#  include <machine/endian.h>
+#elif defined ( SOLARIS )
+#  include <solaris-compat/compat.h>
+#elif defined( __GNUC__ ) || defined( __GNU_LIBRARY__ )
+#  include <endian.h>
+#if !defined(__APPLE__)
+#  include <byteswap.h>
+#endif
+#elif defined( linux )
+#  include <endian.h>
+#endif
+
 #ifdef __linux
 #include <linux/soundcard.h>
 #elif defined(__FreeBSD__)