Files
goldeneye-pc-port/port/shim/PR/ucode.h
T
James Dansereau ed991dd1cb port: D402 — fix the first clean Linux (glibc/SteamOS) build
The release/v0.4.0 branch had never been compiled on Linux; two
port-layer include-resolution spots that MinGW tolerated break under
glibc. Shim-only fixes, zero src/ edits, no rule-2:

- port/shim/PR/ucode.h + port/shim/bondconstants.h: break the
  bondconstants.h -> ultra64.h -> pc_protos.h -> bondtypes.h ->
  bondconstants.h first-include re-entry by deferring pc_protos.h during
  bondconstants.h's own ultra64.h pass (_PORT_DEFER_PC_PROTOS).
- port/shim/PR/gbi.h: define _SHIFTL/_SHIFTR when absent, so video.c's
  gbi.h macros keep their mbi.h definitions on Linux.

Builds + links clean on Ubuntu 24.04 (glibc 2.39 <= SteamOS 2.41).
2026-09-27 23:53:03 -04:00

33 lines
1.3 KiB
C

/*
* PC port shim for PR/ucode.h.
*
* Pass-through to the real header, plus — because ucode.h is the LAST include
* in <ultra64.h> (after libaudio.h, whose partial-parse poisoning is the
* reason pc_protos.h cannot anchor earlier, e.g. in gbi.h) — the D38
* prototype header for implicitly declared game functions.
*
* Inert in the N64 build (port/shim is not on its include path).
*/
#ifndef _PORT_SHIM_UCODE_H_
#define _PORT_SHIM_UCODE_H_
#if defined(PORT)
# include "include/PR/ucode.h"
# /* D402 (Linux build): a TU that includes <bondconstants.h> before
# * <ultra64.h> (e.g. port/src/optionsoverlay.c) sets src/bondconstants.h's
# * include-guard, then that header's own top `#include <ultra64.h>` reaches
# * this pc_protos.h -> bondtypes.h -> bondconstants.h chain while
# * src/bondconstants.h is still mid-parse (its ITEM_IDS/ACT_TYPE/... are
# * defined only later in the file). glibc GCC rejects the half-defined
# * types hard (MinGW tolerated it, so this only surfaced on Linux). The
# * bondconstants.h shim sets _PORT_DEFER_PC_PROTOS around that pass so the
# * D38 prototypes are pulled in only once, after the constants are whole. */
# if !defined(_PORT_DEFER_PC_PROTOS)
# include "pc_protos.h"
# endif
#else
# include <PR/ucode.h>
#endif
#endif /* _PORT_SHIM_UCODE_H_ */