guard the endian bits with HAVE_MACHINE_ENDIAN_H

This commit is contained in:
jasper 2016-04-27 10:41:49 +00:00
parent 0cea667302
commit 2cf9d47a23
2 changed files with 9 additions and 9 deletions

View File

@ -1,9 +1,9 @@
# $OpenBSD: Makefile,v 1.15 2016/04/13 07:52:16 jasper Exp $
# $OpenBSD: Makefile,v 1.16 2016/04/27 10:41:49 jasper Exp $
COMMENT= SPICE protocol headers
DISTNAME= spice-protocol-0.12.11
REVISION= 1
REVISION= 2
CATEGORIES= devel net
HOMEPAGE= http://www.spice-space.org/

View File

@ -1,18 +1,18 @@
$OpenBSD: patch-spice_macros_h,v 1.4 2016/04/13 07:52:16 jasper Exp $
$OpenBSD: patch-spice_macros_h,v 1.5 2016/04/27 10:41:49 jasper Exp $
https://bugs.freedesktop.org/show_bug.cgi?id=94570
--- spice/macros.h.orig Thu Mar 10 14:14:49 2016
+++ spice/macros.h Tue Apr 12 17:56:33 2016
--- spice/macros.h.orig Wed Apr 27 12:15:16 2016
+++ spice/macros.h Wed Apr 27 12:17:29 2016
@@ -381,6 +381,15 @@
#define SPICE_ENDIAN_BIG 1234
#define SPICE_ENDIAN_PDP 2143
+#include <endian.h>
+#ifdef BYTE_ORDER
+# if BYTE_ORDER == LITTLE_ENDIAN
+#ifdef HAVE_MACHINE_ENDIAN_H
+# include <machine/endian.h>
+# if _BYTE_ORDER == _LITTLE_ENDIAN
+# define SPICE_ENDIAN SPICE_ENDIAN_LITTLE
+# elif BYTE_ORDER == BIG_ENDIAN
+# elif _BYTE_ORDER == _BIG_ENDIAN
+# define SPICE_ENDIAN SPICE_ENDIAN_BIG
+# endif
+#endif