aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilas <silas_git@nocafe.net>2020-11-12 08:36:33 -0300
committerSilas <silas_git@nocafe.net>2020-11-12 08:36:33 -0300
commit01eef9f87b72b0c1473672ca17592077b5af1126 (patch)
tree8fbe90c6cba2643304132c376ff233056f5a5137
parentb082d42355d42a6f1ca10659e86132ef7cf6239e (diff)
downloadvis-01eef9f87b72b0c1473672ca17592077b5af1126.tar.gz
vis-01eef9f87b72b0c1473672ca17592077b5af1126.tar.xz
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.
-rwxr-xr-xconfigure1
1 files changed, 1 insertions, 0 deletions
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" ;;