summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2024-01-17 09:47:35 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2024-01-17 09:47:35 +0000
commit7d91b4b90b1eac9fe04a2fab22013bfbb9ff5ee1 (patch)
tree5c933039b7ca96b334af77522f51a23a0bc7d994
parent66369416fc6a50a9800a875173f2af93ed9d5d4d (diff)
htobe is not portable.
-rw-r--r--compat/imsg-buffer.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/compat/imsg-buffer.c b/compat/imsg-buffer.c
index 3de7a7c0..ea236efd 100644
--- a/compat/imsg-buffer.c
+++ b/compat/imsg-buffer.c
@@ -23,7 +23,6 @@
#include <limits.h>
#include <errno.h>
-#include <endian.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
@@ -32,6 +31,13 @@
#include "compat.h"
#include "imsg.h"
+#define htobe16 htons
+#define htobe32 htonl
+#define htobe64 htonll
+#define be16toh ntohs
+#define be32toh ntohl
+#define be64toh ntohll
+
static int ibuf_realloc(struct ibuf *, size_t);
static void ibuf_enqueue(struct msgbuf *, struct ibuf *);
static void ibuf_dequeue(struct msgbuf *, struct ibuf *);