From 4cf22a137323595454ff4ee6332afb73b324b963 Mon Sep 17 00:00:00 2001 From: Nathan Fisher Date: Tue, 22 Aug 2023 03:27:03 -0400 Subject: [PATCH] Fix NetBSD compilation --- Makefile | 4 +++- bytes.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 56065df..88b61fc 100644 --- a/Makefile +++ b/Makefile @@ -55,7 +55,9 @@ CFLAGS += -Wall -Werror CFLAGS += -Iinclude CFLAGS += -fPIC -LIBS += -lmd -lpthread +# Comment this if on NetBSD or OpenBSD +LIBS += -lmd +LIBS += -lpthread all: libhaggis.a libhaggis.so diff --git a/bytes.c b/bytes.c index 06f3899..b39f8b3 100644 --- a/bytes.c +++ b/bytes.c @@ -37,7 +37,7 @@ #include "bytes.h" #include "haggis.h" -#if __BYTE_ORDER__ == __LITTLE_ENDIAN +#if __BYTE_ORDER__ == __LITTLE_ENDIAN || _BYTE_ORDER == _LITTLE_ENDIAN int load_u16(FILE *stream, u16 *num) { return fread(&num->bytes, 1, 2, stream); }