From 999bca81f5bc36fa9244765c89a9c8eda06ffb94 Mon Sep 17 00:00:00 2001 From: James Dansereau <106631954+jkdansereau@users.noreply.github.com> Date: Wed, 2 Sep 2026 21:57:24 -0400 Subject: [PATCH] linux-build: use host for bcopy/bcmp/bzero on the POSIX port glibc's (pulled in transitively, e.g. via _GNU_SOURCE in port/src/crash.c) declares these with size_t sizes; the N64 prototypes here use int, which GCC 14 rejects as conflicting types. On PORT && !_WIN32 include and drop the local decls. Windows (PORT+_WIN32) and the N64 build (no PORT) keep the original prototypes unchanged; Windows build verified green (239/239). --- include/PR/os.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/PR/os.h b/include/PR/os.h index 0a84cd5d..6df1d845 100644 --- a/include/PR/os.h +++ b/include/PR/os.h @@ -980,9 +980,16 @@ extern void osAckRamromWrite(void); /* byte string operations */ +#if defined(PORT) && !defined(_WIN32) +/* On the Linux/macOS port these resolve to the host libc; glibc + * declares them with size_t sizes, which conflict with the N64 `int` + * prototypes below (GCC 14 hard error). Use the host declarations. */ +#include +#else extern void bcopy(const void *, void *, int); extern int bcmp(const void *, const void *, int); extern void bzero(void *, int); +#endif /* Miscellaneous operations */