Simplify endianness goo.

spice-gtk breaks on sparc64 because endianness can't be detected,
because not all source files in spice-gtk include the same config.h
file.  So instead of requiring consumer ports to define HAVE_ENDIAN_H,
let's just assume that we have it.

ok jasper@
This commit is contained in:
jca 2016-11-01 15:58:18 +00:00
parent 0bad3f32f0
commit 530d1b7486
2 changed files with 11 additions and 13 deletions

View File

@ -1,9 +1,9 @@
# $OpenBSD: Makefile,v 1.19 2016/10/15 19:14:20 jasper Exp $
# $OpenBSD: Makefile,v 1.20 2016/11/01 15:58:18 jca Exp $
COMMENT= SPICE protocol headers
DISTNAME= spice-protocol-0.12.12
REVISION= 0
REVISION= 1
CATEGORIES= devel net
HOMEPAGE= http://www.spice-space.org/

View File

@ -1,20 +1,18 @@
$OpenBSD: patch-spice_macros_h,v 1.6 2016/05/02 09:27:19 jasper Exp $
$OpenBSD: patch-spice_macros_h,v 1.7 2016/11/01 15:58:18 jca Exp $
https://bugs.freedesktop.org/show_bug.cgi?id=94570
--- spice/macros.h.orig Thu Mar 10 15:14:49 2016
+++ spice/macros.h Mon May 2 11:22:16 2016
@@ -381,6 +381,15 @@
--- spice/macros.h.orig Thu Mar 10 17:09:31 2016
+++ spice/macros.h Tue Nov 1 13:45:19 2016
@@ -381,6 +381,13 @@
#define SPICE_ENDIAN_BIG 1234
#define SPICE_ENDIAN_PDP 2143
+#ifdef HAVE_ENDIAN_H
+# include <endian.h>
+# if _BYTE_ORDER == _LITTLE_ENDIAN
+# define SPICE_ENDIAN SPICE_ENDIAN_LITTLE
+# elif _BYTE_ORDER == _BIG_ENDIAN
+# define SPICE_ENDIAN SPICE_ENDIAN_BIG
+# endif
+#include <endian.h>
+#if BYTE_ORDER == LITTLE_ENDIAN
+# define SPICE_ENDIAN SPICE_ENDIAN_LITTLE
+#elif BYTE_ORDER == BIG_ENDIAN
+# define SPICE_ENDIAN SPICE_ENDIAN_BIG
+#endif
+
/* gcc already defined these, use them */