Files
James Dansereau fe7a34c56e linux-build: port/shim/sched.h routes C++ TUs to the host <sched.h>
The decomp's src/sched.h (N64 OSSc* scheduler) is on the include path and
shadows the system header. libstdc++'s <thread>/<mutex> gthr headers in the
fast3d C++ TUs #include <sched.h> and need the real one (cpu_set_t,
sched_yield) -- with -std=gnu++20 libstdc++ defines _GNU_SOURCE so
<pthread.h> also references cpu_set_t. New shim: C++ -> generated
hostsched.h (absolute path, hoststring pattern); C -> #include_next so
src/sched.h still wins as before. Windows build verified green (240/241).
2026-09-02 22:31:33 -04:00

19 lines
692 B
C

/*
* PC port shim for <sched.h>.
*
* The decomp ships src/sched.h (the N64 OSSc* scheduler client interface),
* which is on the compiler include path. libstdc++'s <thread> / gthr headers
* (pulled into the fast3d C++ TUs) do `#include <sched.h>` and need the HOST
* header — cpu_set_t, sched_yield — so C++ TUs must be routed to the real
* <sched.h> by absolute path (generated hostsched.h, same trick as
* port/shim/string.h). C TUs keep resolving <sched.h> to the decomp's own
* src/sched.h, exactly as on the console.
*
* Inert in the N64 build (port/shim is not on its include path).
*/
#if defined(__cplusplus)
#include "hostsched.h"
#else
#include_next <sched.h>
#endif