$OpenBSD: patch-src_crypt_h,v 1.1 2014/06/06 09:08:37 dcoppa Exp $

Fix an issue with byte switching. The preprocessor directive used to
determine the endianess of the system only worked on Linux resulting in
voice running over TCP only when umurmur runs on other platforms.

Adapted from upstream git commit 27da14ea2abe5680ddfcffbf2a59be5f5a67cecd

--- src/crypt.h.orig	Fri Jun  6 10:01:06 2014
+++ src/crypt.h	Fri Jun  6 10:08:44 2014
@@ -31,6 +31,20 @@
 #ifndef CRYPTSTATE_H_34564356
 #define CRYPTSTATE_H_34564356
 
+#include <stdint.h>
+
+#if defined(NETBSD) || defined(FREEBSD) || defined(OPENBSD) || defined(MACOSX)
+#include <machine/endian.h>
+#if BYTE_ORDER == BIG_ENDIAN
+#define BYTE_ORDER_BIG_ENDIAN
+#endif // BYTE_ORDER == BIG_ENDIAN
+#elif defined(LINUX)
+#include <endian.h>
+#if __BYTE_ORDER == __BIG_ENDIAN
+#define BYTE_ORDER_BIG_ENDIAN
+#endif // __BYTE_ORDER == __BIG_ENDIAN
+#endif // defined(NETBSD) || defined(FREEBSD) || defined(OPENBSD)
+
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
@@ -44,7 +58,6 @@
 #include <openssl/aes.h>
 #endif
 
-#include <stdint.h>
 #include "timer.h"
 #include "types.h"
 
