Commit d3cb174
compiler.h/file.c: include <windows.h> before Windows SDK headers
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.
Move the fix to include/compiler.h, since <windows.h> is needed
broadly for Windows-specific functionality and other source files may
hit the same problem in the future. Include it (with
WIN32_LEAN_AND_MEAN) right after the _MBCS define, guarded by _WIN32,
before anything else gets a chance to include a Windows SDK header on
its own. file.c's direct <stringapiset.h> include is now redundant and
removed; <wchar.h> is kept since it's still used for the wchar_t type.
Confirmed fixed with a real MSVC (cl.exe/nmake) build in CI.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent e2f38a8 commit d3cb174
2 files changed
Lines changed: 18 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
27 | 43 | | |
28 | 44 | | |
29 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
| 49 | + | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| |||
0 commit comments