Skip to content

Conversation

@chicogong
Copy link
Owner

Summary

Fix Windows build failure caused by undefined M_PI constant in MSVC.

Root Cause

MSVC doesn't define M_PI by default when including <cmath>. The macro _USE_MATH_DEFINES must be defined before including <cmath> to enable math constants.

Changes

Added _USE_MATH_DEFINES definition for Windows builds in:

  • src/audio/audio_processor.cpp
  • tests/utils/test_signal_generator.h
  • tests/fixtures/audio_test_fixture.h
  • tests/unit/test_rnnoise_processor.cpp
  • tests/unit/test_audio_converter.cpp

Test Plan

  • Local build passes (Linux)
  • All 114 unit tests pass
  • Windows CI should now pass

MSVC requires _USE_MATH_DEFINES to be defined before including <cmath>
to make M_PI and other math constants available.

Files updated:
- src/audio/audio_processor.cpp
- tests/utils/test_signal_generator.h
- tests/fixtures/audio_test_fixture.h
- tests/unit/test_rnnoise_processor.cpp
- tests/unit/test_audio_converter.cpp
@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@chicogong chicogong merged commit 0682ad0 into master Dec 29, 2025
11 of 12 checks passed
@chicogong chicogong deleted the fix/windows-m_pi branch December 29, 2025 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants