mirror of
https://github.com/netwide-assembler/nasm
synced 2026-08-26 16:23:04 -04:00
nasmlib/file.c included <stringapiset.h> directly (for MultiByteToWideChar()/CompareStringOrdinal()) without first including <windows.h>. Windows SDK headers like <stringapiset.h> are only guaranteed to work when pulled in through the normal <windows.h> pipeline, which sets up SDK-internal architecture macros (_X86_, _AMD64_, ...) derived from the compiler's own _M_IX86/_M_X64/etc. Including them directly skips that setup and can fail with a 'No Target Architecture' #error from <winnt.h> -- which is exactly what happened building with a real cl.exe/nmake in CI. <windows.h> is deliberately *not* pulled in globally from compiler.h: it #defines NEAR and FAR as legacy no-op calling-convention keywords, which clash with NASM's own NEAR/FAR opflags bits (include/opflags.h). Keep the inclusion local to file.c, the only file that currently needs Windows API declarations, guarded by WIN32_LEAN_AND_MEAN to keep the exposed surface minimal. Confirmed fixed with a real MSVC (cl.exe/nmake) build in CI. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| alloc.c | ||
| alloc.h | ||
| asprintf.c | ||
| badenum.c | ||
| bsi.c | ||
| crc32b.c | ||
| crc64.c | ||
| file.c | ||
| fileio.c | ||
| hashtbl.c | ||
| ilog2.c | ||
| md5c.c | ||
| mmap.c | ||
| nctype.c | ||
| numstr.c | ||
| path.c | ||
| perfhash.c | ||
| perfhash.pl | ||
| raa.c | ||
| rbtree.c | ||
| readnum.c | ||
| realpath.c | ||
| rlimit.c | ||
| saa.c | ||
| string.c | ||
| strlist.c | ||
| ver.c | ||
| zerobuf.c | ||