commit f265eea34d1984d43bd51b2fa50e7222fb7a35e8
parent df5ed8f87c723875c581e8914a10141ad975b3d7
Author: Chris Bracken <chris@bracken.jp>
Date: Sat, 21 Feb 2026 08:58:37 +0900
openbsd: fix BSD build
Since we're declaring _POSIX_C_SOURCE and _XOPEN_SOURCE we still need
these declarations. They're there in libc but hidden in the headers.
Diffstat:
3 files changed, 3 insertions(+), 11 deletions(-)
diff --git a/third_party/openbsd/reallocarray.h b/third_party/openbsd/reallocarray.h
@@ -3,9 +3,7 @@
#include <stdlib.h>
-#if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && \
- !defined(__DragonFly__)
+#undef reallocarray
void* reallocarray(void* optr, size_t nmemb, size_t size);
-#endif
#endif // OPENBSD_REALLOCARRAY_H_
diff --git a/third_party/openbsd/strlcat.h b/third_party/openbsd/strlcat.h
@@ -1,12 +1,9 @@
#ifndef OPENBSD_STRLCAT_H_
#define OPENBSD_STRLCAT_H_
-#include <string.h>
#include <sys/types.h>
-#if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && \
- !defined(__DragonFly__) && !defined(__APPLE__)
+#undef strlcat
size_t strlcat(char* dst, const char* src, size_t dsize);
-#endif
#endif // OPENBSD_STRLCAT_H_
diff --git a/third_party/openbsd/strlcpy.h b/third_party/openbsd/strlcpy.h
@@ -1,12 +1,9 @@
#ifndef OPENBSD_STRLCPY_H_
#define OPENBSD_STRLCPY_H_
-#include <string.h>
#include <sys/types.h>
-#if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && \
- !defined(__DragonFly__) && !defined(__APPLE__)
+#undef strlcpy
size_t strlcpy(char* dst, const char* src, size_t dsize);
-#endif
#endif // OPENBSD_STRLCPY_H_