forked from Ports/goldeneye-pc-port
All ~235 translation units now compile and the target links under MSYS2 GCC 16 + CMake/Ninja (ninja ge007 -k 0: 236/236, zero errors). N64 build untouched; every src/ change is -DPORT-gated. Portability fixes (findings D7-D17 in docs/PCPortResearch.md section 11): - AI X-macro system: SWITCH() call sites activated to the author's hand-written byte-identical references under PORT; port/shim/ bondaicommands.h + bondconstants.h + CPPLib.h re-emit the IDO paste tricks (isSubroutine, file-record macros, generated CALL) GCC-clean. - 64-bit pointer-in-word initializers: monAnim jump targets now go through an index table resolved by the interpreter (chrai.h/propobj.c); UsetuplenZ.c credits pointer PORT-gated to 0. - IDO printf engine compiled for PC (xprintf/xlitob/xldtob) with a shadow xstdio.h resolving the _Printf prototype clash. - Host-libc gaps stubbed in port/: bcopy/bzero, __libm_qnan_f, tlbmanage*, g_ViXScales/YScales; chrObjRandom PRNG ported from .s. Asset data strategy (D16): single-file assets compiled for real (animation tables, fonts, textures, rareware logo); obseg per-file .c excluded (colliding file-local globals the N64 build isolates via per-ELF linking); 758 ROM-derived table symbols + ramrom_* + segment markers stubbed in port/src/assetstubs.c / n64stubs.c. fast3d is a no-op placeholder (port/src/gfxstub.c) until Phase 2 brings in the real software RSP. Binary not yet runnable end-to-end: ROM loading in romdata.c is still a TODO.
26 lines
1.1 KiB
C
26 lines
1.1 KiB
C
/*
|
|
* PC port shadow of src/libultra/libc/xstdio.h.
|
|
*
|
|
* xprintf.c (the IDO printf engine, compiled for the PC — see CMakeLists.txt)
|
|
* DEFINES _Printf() with `char *` parameters:
|
|
* int _Printf(outfun prout, char *arg, const char *fmt, va_list args)
|
|
* while this header DECLARES it with `u8 *`:
|
|
* int _Printf(outfun prout, u8 *arg, const u8 *fmt, va_list args);
|
|
* IDO treats signed/unsigned-char pointers as compatible; GCC makes the
|
|
* mismatch a hard error. So under PORT we rename the declaration before
|
|
* pulling in the real header: the renamed prototype is harmless (it names a
|
|
* function that is never defined or called), and xprintf.c's definition
|
|
* becomes the sole _Printf prototype. The only caller, src/sprintf.c, does
|
|
* not include this header at all — it calls _Printf with an implicit
|
|
* declaration and passes its char*-based proutSprintf, which matches
|
|
* xprintf.c's definition exactly.
|
|
*
|
|
* Inert in the N64 build: port/shim is not on its include path.
|
|
*/
|
|
|
|
#if defined(PORT)
|
|
#define _Printf _Printf_u8decl
|
|
#include_next <libc/xstdio.h>
|
|
#undef _Printf
|
|
#endif
|