Files
nixpkgs/pkgs/servers/varnish/patches/0001-fix-endian-h-compatibility-on-macos.patch
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

44 lines
1.1 KiB
Diff

From 7a1c7020db85699e0693d637f6e31d49bf9ca3d0 Mon Sep 17 00:00:00 2001
From: Rui Chen <rui@chenrui.dev>
Date: Sun, 25 May 2025 23:54:29 -0400
Subject: [PATCH] libvarnish: Fix endian.h compatibility for macOS builds
Signed-off-by: Rui Chen <rui@chenrui.dev>
---
lib/libvarnish/vsha256.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/lib/libvarnish/vsha256.c b/lib/libvarnish/vsha256.c
index 29f97fe40..541b6e612 100644
--- a/lib/libvarnish/vsha256.c
+++ b/lib/libvarnish/vsha256.c
@@ -31,7 +31,14 @@
#include "config.h"
-#ifndef __DARWIN_BYTE_ORDER
+#ifdef __APPLE__
+# include <machine/endian.h>
+# include <libkern/OSByteOrder.h>
+# define htobe32(x) OSSwapHostToBigInt32(x)
+# define htobe64(x) OSSwapHostToBigInt64(x)
+# define VBYTE_ORDER __DARWIN_BYTE_ORDER
+# define VBIG_ENDIAN __DARWIN_BIG_ENDIAN
+#else
# include <endian.h>
# ifdef _BYTE_ORDER
# define VBYTE_ORDER _BYTE_ORDER
@@ -43,9 +50,6 @@
# else
# define VBIG_ENDIAN __BIG_ENDIAN
# endif
-#else
-# define VBYTE_ORDER __DARWIN_BYTE_ORDER
-# define VBIG_ENDIAN __DARWIN_BIG_ENDIAN
#endif
#ifndef VBYTE_ORDER
--
2.49.0