diff options
author | Eric Wong <e@80x24.org> | 2023-09-09 12:01:41 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2023-09-09 21:44:02 +0000 |
commit | 831a8eb3b396e7d5fcee65b5fd32b2b5be5df61a (patch) | |
tree | 3ecf43342465648c08bb86e86ed509679191be2f /lib/PublicInbox/xap_helper.h | |
parent | 3e37f2548f099c5e8412e1ba1e1fa850c9f8f295 (diff) | |
download | public-inbox-831a8eb3b396e7d5fcee65b5fd32b2b5be5df61a.tar.gz |
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.
Diffstat (limited to 'lib/PublicInbox/xap_helper.h')
-rw-r--r-- | lib/PublicInbox/xap_helper.h | 3 |
1 files changed, 3 insertions, 0 deletions
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 <sys/file.h> #include <sys/mman.h> #include <sys/resource.h> |