Skip to content

fix: recognize MSVC ARM64 in minih264 NEON detection - #637

Merged
BenJule merged 1 commit into
developfrom
fix/636-arm64-neon-detection
Jul 27, 2026
Merged

fix: recognize MSVC ARM64 in minih264 NEON detection#637
BenJule merged 1 commit into
developfrom
fix/636-arm64-neon-detection

Conversation

@BenJule

@BenJule BenJule commented Jul 27, 2026

Copy link
Copy Markdown
Owner

Nightly #166 (first run with the new windows-11-arm target) failed with:

src/minimp4/minih264e.h(357,1): error C1189: MINIH264_ONLY_SIMD used, but SSE/NEON not enabled

MINIH264_ONLY_SIMD is already correctly defined for MSVC ARM64 (checks _M_ARM64), but the NEON-enabling condition only tested __ARM_NEON/__aarch64__ - GCC/Clang macros MSVC never defines on ARM64 (it uses _M_ARM64 instead). So MSVC/ARM64 fell through both the SSE2 and NEON branches and hit the #error.

One-line fix: add _M_ARM64 to the NEON condition. Checked the CMakeLists for these files - no hardcoded SSE-specific compiler flags that would conflict on ARM64.

Closes #636

MINIH264_ONLY_SIMD was already correctly defined for MSVC ARM64 (checks
_M_ARM64), but the NEON-enabling check only tested __ARM_NEON/__aarch64__ -
GCC/Clang macros that MSVC never defines on ARM64. Falls through both
branches and hits the #error on Windows ARM64 builds.

Closes #636
@BenJule BenJule self-assigned this Jul 27, 2026
@BenJule
BenJule requested a review from Copilot July 27, 2026 13:53
@github-actions github-actions Bot added area: ci GitHub Actions, CI/CD platform: macos macOS-specific issue platform: windows Windows-specific issue labels Jul 27, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@BenJule
BenJule merged commit 1ef1ecb into develop Jul 27, 2026
11 of 12 checks passed
@BenJule
BenJule deleted the fix/636-arm64-neon-detection branch July 27, 2026 14:00
BenJule added a commit that referenced this pull request Jul 27, 2026
…) (#639)

#637 got the Windows ARM64 build past the SIMD detection gate, but it
then hit a real code issue further in:

```
src/minimp4/minih264e.h(5465,103): error C2078: too many initializers
```

```c
static const uint16x8_t g_ign_first = { 0, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff };
```

GCC/Clang allow brace-elision when aggregate-initializing the underlying
struct of a NEON vector type; MSVC's ARM64 NEON types don't. Adding the
nested braces is valid on all compilers (it's just the explicit,
non-elided form), so this doesn't touch the already-working Linux/macOS
NEON builds - checked the whole file, this is the only place with this
pattern.

Closes #636
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ci GitHub Actions, CI/CD platform: macos macOS-specific issue platform: windows Windows-specific issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants