From 78d9eee14173cfd9f2ffb2a448319563913773d3 Mon Sep 17 00:00:00 2001
From: Mark Spencer <markster@digium.com>
Date: Thu, 24 Mar 2005 22:01:56 +0000
Subject: [PATCH] Fix OSS endian issues in OSS (bug #3846)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5255 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 channels/chan_oss.c | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/channels/chan_oss.c b/channels/chan_oss.c
index 316529c947..480408eb75 100755
--- a/channels/chan_oss.c
+++ b/channels/chan_oss.c
@@ -34,7 +34,24 @@
 #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__)
-- 
GitLab