Skip to content

Commit 2f4e290

Browse files
borisbatclaude
andcommitted
fix: include windows.h for the arm64 Windows cpu_supports branch
The _M_ARM64 path calls IsProcessorFeaturePresent with PF_ARM_* constants, but nothing in this TU's include graph pulls windows.h in — include/daScript/ does not include it anywhere — so an arm64 Windows build would not compile. CI has no windows-arm64 lane, so this would have shipped latent. Guarded to arm64 + _WIN32, with NOMINMAX and WIN32_LEAN_AND_MEAN, so no lane CI actually builds sees any change. Caught by Copilot on #3583. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent e4c1ff2 commit 2f4e290

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

src/builtin/module_builtin_runtime.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,19 @@
2424
#include "../parser/parser_impl.h"
2525

2626
// arm64 CPU-feature detection headers — MUST be at file scope, not inside `namespace das`.
27+
// Guarded to arm64, so no other target's translation unit is affected by anything here.
2728
#if defined(__aarch64__) || defined(_M_ARM64)
28-
#if defined(__APPLE__)
29+
#if defined(_WIN32)
30+
// IsProcessorFeaturePresent + the PF_ARM_* constants; nothing else in this TU's include
31+
// graph pulls windows.h in, so without this the arm64 Windows build does not compile.
32+
#ifndef NOMINMAX
33+
#define NOMINMAX
34+
#endif
35+
#ifndef WIN32_LEAN_AND_MEAN
36+
#define WIN32_LEAN_AND_MEAN
37+
#endif
38+
#include <windows.h>
39+
#elif defined(__APPLE__)
2940
#include <sys/sysctl.h>
3041
#elif defined(__linux__)
3142
#include <sys/auxv.h>

0 commit comments

Comments
 (0)