Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

windows support #1

Merged
merged 2 commits into from
Nov 22, 2023
Merged

windows support #1

merged 2 commits into from
Nov 22, 2023

Conversation

marler8997
Copy link
Contributor

@marler8997 marler8997 commented Nov 22, 2023

Contains 2 commits, the first one adds support for non-vla compilers (like MSVC), upstream change is here: xiph/rnnoise#219

Second commit updates our CMakeLists.txt file to add the _USE_MATH_DEFINES to expose the M_PI definition on MSVC. This change can't be upstreamed since upstream doesn't use CMAKE. We could try to define _USE_MATH_DEFINES in the source code, but it's less brittle to do it in the build system since doing it in source would require enforcing that it gets defined before math.h which is difficult to guarantee.

I tested that this still builds on linux and it should theortically have no affect. Would like to double check that this also has no affect on macOS...by testing that the C macro is taking the proper codepath.

Leverages the C std version and the standard __STDC_NO_VLA__ macro
to detect whether VLA is supported, and if not falls back to using alloca.
The MSVC compiler only exposes M_PI if _USE_MATH_DEFINES is defined...
don't ask me why.
@marler8997 marler8997 changed the title handle non-vla compilers windows support Nov 22, 2023
@marler8997 marler8997 merged commit b191758 into master Nov 22, 2023
@marler8997 marler8997 deleted the novla branch November 22, 2023 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants