From c8532ae7a9f55f333165db8bcd759410445e62e0 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Wed, 25 Dec 2019 11:21:49 -0700 Subject: [PATCH] Enable OpenBSD extensions on NetBSD to get reallocarray(3) prototype. --- config.h.in | 5 +++++ configure | 4 ++++ configure.ac | 8 ++++++++ 3 files changed, 17 insertions(+) diff --git a/config.h.in b/config.h.in index 7966d5559..412f9b8bd 100644 --- a/config.h.in +++ b/config.h.in @@ -1286,6 +1286,11 @@ # undef _BSD_SOURCE #endif +/* Enable OpenBSD extensions on NetBSD. */ +#ifndef _OPENBSD_SOURCE +# undef _OPENBSD_SOURCE +#endif + /* Enable BSD types on IRIX. */ #ifndef _BSD_TYPES # undef _BSD_TYPES diff --git a/configure b/configure index 924a20d8e..1ff27230a 100755 --- a/configure +++ b/configure @@ -16284,6 +16284,10 @@ done test -z "$with_pam" && AUTH_EXCL_DEF="PAM" : ${with_logincap='maybe'} + # For reallocarray() + $as_echo "#define _OPENBSD_SOURCE 1" >>confdefs.h + + # Examples go in share/examples/sudo if test X"$with_exampledir" = X""; then exampledir='$(datarootdir)/examples/$(PACKAGE_TARNAME)' diff --git a/configure.ac b/configure.ac index 18c5fc234..3eea639da 100644 --- a/configure.ac +++ b/configure.ac @@ -2189,6 +2189,9 @@ case "$host" in test -z "$with_pam" && AUTH_EXCL_DEF="PAM" : ${with_logincap='maybe'} + # For reallocarray() + AC_DEFINE([_OPENBSD_SOURCE]) + # Examples go in share/examples/sudo if test X"$with_exampledir" = X""; then exampledir='$(datarootdir)/examples/$(PACKAGE_TARNAME)' @@ -4737,6 +4740,11 @@ AH_BOTTOM([/* BSD compatibility on some SVR4 systems. */ # undef _BSD_SOURCE #endif +/* Enable OpenBSD extensions on NetBSD. */ +#ifndef _OPENBSD_SOURCE +# undef _OPENBSD_SOURCE +#endif + /* Enable BSD types on IRIX. */ #ifndef _BSD_TYPES # undef _BSD_TYPES