logo

utils-std

Collection of commonly available Unix tools
commit: 55ecff146288046783aba44af4f8dbe135ca633b
parent 8bc0e68a8dcfd5a1ad4d16d111d6d72a91e78039
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Sun,  5 May 2024 03:03:19 +0200

Use _BSD_SOURCE / _OPENBSD_SOURCE for reallocarray

Diffstat:

Mconfigure.d/reallocarray.c8+++++---
Mlib/tr_str.c6+++++-
2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/configure.d/reallocarray.c b/configure.d/reallocarray.c @@ -2,9 +2,11 @@ // SPDX-FileCopyrightText: 2017 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me> // SPDX-License-Identifier: MPL-2.0 -// Because that's what our utilities will use :) -#define _POSIX_C_SOURCE 200809L -#define _DEFAULT_SOURCE // for reallocarray +// For reallocarray +#define _BSD_SOURCE +#if __NetBSD_Version__ < 1000000000 +#define _OPENBSD_SOURCE +#endif #include <stdlib.h> // reallocarray diff --git a/lib/tr_str.c b/lib/tr_str.c @@ -31,7 +31,11 @@ * SUCH DAMAGE. */ -#define _DEFAULT_SOURCE +// For reallocarray +#define _BSD_SOURCE +#if __NetBSD_Version__ < 1000000000 +#define _OPENBSD_SOURCE +#endif #include "./tr_str.h"