From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id E19BA1F56B for ; Sat, 9 Sep 2023 12:01:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1694260903; bh=1IQyAM6PrFAQGbReQgzTIOQsumqKPkXFUTd+Gv6mvng=; h=From:To:Subject:Date:In-Reply-To:References:From; b=c+YY1jB/ugaDP3jyU9zbOUdN02IF+OUf7trEgcBaHUx3dxnJ4D3pxlXN+wV7hd6qC 556ApafGiJ2n8UgIHqmHG08pgB0+S1qu1kidm2VB0stRFtEhaREPrvDujdaWxLy8Ti 5c9i5OOg0tHlIvX5+3Ec8YGaBAW3hNWx0UxGJZjk= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 7/8] xap_helper: use _OPENBSD_SOURCE on NetBSD for reallocarray Date: Sat, 9 Sep 2023 12:01:41 +0000 Message-ID: <20230909120142.1041752-8-e@80x24.org> In-Reply-To: <20230909120142.1041752-1-e@80x24.org> References: <20230909120142.1041752-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: NetBSD prefers reallocarr(3) for predictable zero-sized allocation behavior; but no other OS seems to have reallocarr(3). reallocarray(3) appears in by OpenBSD, FreeBSD, glibc, and musl, so continue to go with that. --- lib/PublicInbox/xap_helper.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/PublicInbox/xap_helper.h b/lib/PublicInbox/xap_helper.h index 3f45e1c7..add2fe8c 100644 --- a/lib/PublicInbox/xap_helper.h +++ b/lib/PublicInbox/xap_helper.h @@ -14,6 +14,9 @@ #ifndef _ALL_SOURCE # define _ALL_SOURCE #endif +#if defined(__NetBSD__) && !defined(_OPENBSD_SOURCE) // for reallocarray(3) +# define _OPENBSD_SOURCE +#endif #include #include #include