onnxruntime
fe7700a7 - fix: scope tpause_spin_delay_cycles to the _tpause branch (#33532)

Commit
5 days ago
fix: scope tpause_spin_delay_cycles to the _tpause branch (#33532) ## Description Fixes #33431. `tpause_spin_delay_cycles` lived next to `has_tpause` but was only referenced inside the `#if (defined(_WIN32) && !defined(__clang__)) || defined(__WAITPKG__)` branch that calls `_tpause`. Builds that take the `_mm_pause()` fallback treated the constant as unused and failed under `-Werror=unused-variable`. Move the constant into the branch that uses it so every configuration that defines it also references it. ## Motivation and Context Reported in #33431: FreeBSD/ports-style builds (and other non-WAITPKG x86_64 toolchains) fail compiling `spin_pause.cc` because of the unused `static constexpr`. ## How was this change tested? Compile-only change; no runtime behavior change when `_tpause` is available. Verified the constant is now lexically scoped to the same `#if` that consumes it. ## Checklist - [x] I have followed the [PR Guidelines](https://github.com/microsoft/onnxruntime/blob/main/docs/PR_Guidelines.md) --------- Co-authored-by: ninglinLiu <ninglinLiu@users.noreply.github.com>
Author
Parents
Loading