Commit b278d09
builtin: fix GetFinalPathNameByHandleW declaration for TCC on Windows
TCC''s bundled windows.h does not chain-include fileapi.h, so
GetFinalPathNameByHandleW had no C declaration in scope when TCC
compiled any program that pulled in builtin. TCC (in C99 mode)
treats implicit function declarations as hard errors.
Add an explicit #include <fileapi.h> inside a $if windows {} block
alongside the function declaration. V already passes
thirdparty/tcc/include/winapi to TCC''s include search path, so TCC
resolves the declaration from its own bundled header (which carries
the correct DWORD WINAPI signature). GCC and MSVC receive a harmless
redundant include since fileapi.h has include guards.
Keeping the declaration in $if windows {} also stops it from being
compiled into Linux/macOS builds, where the symbol does not exist.
Co-Authored-By: WOZCODE <contact@withwoz.com>1 parent c0624b2 commit b278d09
1 file changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
295 | 295 | | |
296 | 296 | | |
297 | 297 | | |
298 | | - | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
299 | 303 | | |
300 | 304 | | |
301 | 305 | | |
| |||
0 commit comments