Fix desktop/Android build breaks from the ios/pr-ready merge

The ios/pr-ready merge (04ea993e99) introduced two independent
regressions in the shared core:

1. DEV9/AdapterUtils.cpp included Apple-only <TargetConditionals.h>
   unconditionally under __POSIX__, so every non-Apple POSIX target
   (Linux, Android, FreeBSD) failed to compile. Guard the include with
   __APPLE__; TARGET_OS_IPHONE is only consulted to keep iOS out of the
   BSD-socket block, and on non-Apple it correctly evaluates to 0.

2. SPU2::RegisterNEONBackend() is called from spu2.cpp on every arm64
   target (guarded by __aarch64__ / _M_ARM64), but spu2_neon.cpp was
   only added to the build for Android/iOS -- so desktop arm64
   (macOS/Linux/Windows) failed to link with an undefined symbol.
   Compile spu2_neon.cpp on all ARCH_ARM64 targets. The NEON reverb
   backend stays opt-in (SPU2/NeonReverbSIMD, default off).

   While wiring it up for desktop:
   - Drop the unused spu2_neon_mixer/_reverb_ex/_dcfilter includes from
     spu2_neon.cpp. They hold helpers for a mixer.cpp/ReaVerb.cpp
     integration that hasn't happened, and use the MSVC-only
     __forceinline keyword unguarded (breaks clang). The TU only needs
     the reverb FIR plus the SVE2 hook.
   - Guard spu2_optimize.h's x86-only <xmmintrin.h>/_mm_prefetch off
     MSVC-on-ARM64 (falls back to the no-op prefetch).

Verified locally: clean Release build + link on Linux arm64
(RegisterNEONBackend now defined in the binary).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Brian Degenhardt
2026-07-12 16:32:50 -07:00
co-authored by Claude Opus 4.8
parent df3dc1f584
commit 5cbcadaa1e
4 changed files with 30 additions and 7 deletions
+7
View File
@@ -21,7 +21,14 @@
#include <sys/ioctl.h>
#include <string.h>
// TargetConditionals.h (which defines TARGET_OS_IPHONE) is an Apple-only header.
// Guard the include so non-Apple POSIX targets (Linux, Android, FreeBSD) still
// build: on those, TARGET_OS_IPHONE is undefined and evaluates to 0 in the #if
// below, while the __FreeBSD__/__APPLE__ gate already keeps them out of the
// BSD-socket block. The net effect is that only iOS is excluded here.
#ifdef __APPLE__
#include <TargetConditionals.h>
#endif
#if (defined(__FreeBSD__) || (__APPLE__)) && !TARGET_OS_IPHONE
#include <sys/types.h>
#include <net/if_dl.h>