nasm/nasmlib
H. Peter Anvin (Intel) ace0078261 file.c: include <windows.h> before <stringapiset.h>
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>
2026-07-07 13:12:06 -07:00
..
alloc.c Add nasm_strdupto() and nasm_strto(), to replace a string variable 2026-06-26 17:25:23 -07:00
alloc.h treewide: replace verbose copyright headers with SPDX tags 2025-10-01 11:45:31 -07:00
asprintf.c treewide: replace verbose copyright headers with SPDX tags 2025-10-01 11:45:31 -07:00
badenum.c treewide: replace verbose copyright headers with SPDX tags 2025-10-01 11:45:31 -07:00
bsi.c treewide: replace verbose copyright headers with SPDX tags 2025-10-01 11:45:31 -07:00
crc32b.c nasmlib: rename crc32.c to crc32b.c to avoid conflict with zlib/crc32.c 2025-10-09 14:49:22 -07:00
crc64.c treewide: replace verbose copyright headers with SPDX tags 2025-10-01 11:45:31 -07:00
file.c file.c: include <windows.h> before <stringapiset.h> 2026-07-07 13:12:06 -07:00
fileio.c nasmlib: split file.c into file.c and fileio.c; remove file.h 2025-12-14 17:47:47 -08:00
hashtbl.c Conditionalize __builtin_prefetch() on it existing!! 2025-10-03 10:47:23 -07:00
ilog2.c ilog2(): inline functions if practical 2017-09-27 13:34:42 -07:00
md5c.c Move <string.h> inclusion to compiler.h 2018-12-26 06:32:37 -08:00
mmap.c nasmlib: mmap.c included the deleted "file.h", but didn't need it 2025-12-16 17:32:25 -08:00
nctype.c treewide: replace verbose copyright headers with SPDX tags 2025-10-01 11:45:31 -07:00
numstr.c nasmlib/numstr.c: check for buflen == 0 2026-04-07 23:09:21 -07:00
path.c Drop const from the output of filename_set_extension() 2026-06-26 17:24:17 -07:00
perfhash.c treewide: replace verbose copyright headers with SPDX tags 2025-10-01 11:45:31 -07:00
perfhash.pl treewide: replace verbose copyright headers with SPDX tags 2025-10-01 11:45:31 -07:00
raa.c treewide: replace verbose copyright headers with SPDX tags 2025-10-01 11:45:31 -07:00
rbtree.c treewide: replace verbose copyright headers with SPDX tags 2025-10-01 11:45:31 -07:00
readnum.c error: factor out error functions into separate files 2025-11-07 14:42:33 -08:00
realpath.c treewide: replace verbose copyright headers with SPDX tags 2025-10-01 11:45:31 -07:00
rlimit.c nasmlib/rlimit.c: fix broken comment 2025-10-01 13:53:05 -07:00
saa.c saa: make saa_wleb128[us]() take appropriate types; recode 2026-04-06 16:43:51 -07:00
string.c treewide: replace verbose copyright headers with SPDX tags 2025-10-01 11:45:31 -07:00
strlist.c Conditionalize __builtin_prefetch() on it existing!! 2025-10-03 10:47:23 -07:00
ver.c treewide: replace verbose copyright headers with SPDX tags 2025-10-01 11:45:31 -07:00
zerobuf.c treewide: replace verbose copyright headers with SPDX tags 2025-10-01 11:45:31 -07:00