From 01eef9f87b72b0c1473672ca17592077b5af1126 Mon Sep 17 00:00:00 2001 From: Silas Date: Thu, 12 Nov 2020 08:36:33 -0300 Subject: build: add -D_NETBSD_SOURCE for NetBSD memrchr() signature is not exposed by default for NetBSD. If one does not add -D_NETBSD_SOURCE, the compiler uses its own signature for memrchr() that returns a 32-bit integer, leading to misbehaviour in some situations. Defining _BSD_SOURCE doesn't work, so we define _NETBSD_SOURCE. --- configure | 1 + 1 file changed, 1 insertion(+) diff --git a/configure b/configure index 9d5bf0d..4d8f7b1 100755 --- a/configure +++ b/configure @@ -227,6 +227,7 @@ OS=$(uname) case "$OS" in FreeBSD|DragonFly) CFLAGS_STD="$CFLAGS_STD -D_BSD_SOURCE -D__BSD_VISIBLE=1" ;; +NetBSD) CFLAGS_STD="$CFLAGS_STD -D_NETBSD_SOURCE" ;; *BSD) CFLAGS_STD="$CFLAGS_STD -D_BSD_SOURCE" ;; Darwin) CFLAGS_STD="$CFLAGS_STD -D_DARWIN_C_SOURCE" ;; AIX) CFLAGS_STD="$CFLAGS_STD -D_ALL_SOURCE" ;; -- cgit v1.2.3