commit:     913d23e85ae155edf6f9d957ecc6e938caf91683
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 28 16:56:59 2017 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Fri Dec 29 11:16:09 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=913d23e8

hash_fd: ensure __BYTE_ORDER is set

Fallback to using sys/param.h when __BYTE_ORDER isn't set (which it
isn't on Darwin at least)

 libq/hash_fd.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/libq/hash_fd.c b/libq/hash_fd.c
index c021267..49e3af5 100644
--- a/libq/hash_fd.c
+++ b/libq/hash_fd.c
@@ -28,6 +28,19 @@
 #include <string.h>
 #include <unistd.h>
 
+#ifdef HAVE_SYS_PARAM_H
+# include <sys/param.h>
+# ifndef __BYTE_ORDER
+#  define __BYTE_ORDER BYTE_ORDER
+# endif
+# ifndef __BIG_ENDIAN
+#  define __BIG_ENDIAN BIG_ENDIAN
+# endif
+# ifndef __LITTLE_ENDIAN
+#  define __LITTLE_ENDIAN LITTLE_ENDIAN
+# endif
+#endif
+
 #include "busybox.h"
 
 #ifdef CONFIG_SHA1SUM

Reply via email to