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

Fix cmake build on windows #197

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Segfault1602
Copy link

CMake build was broken on windows due to M_E being undeclared. Fix is to define _USE_MATH_DEFINES on windows when building the library.

@Alloyed
Copy link

Alloyed commented Jun 22, 2024

found this, and one other thing on my attempt to build msvc. in ladder.cpp

__attribute__((optimize("unroll-loops"))) void
void LadderFilter::ProcessBlock(float* buf, size_t size)
{
    for(size_t i = 0; i < size; i++)
    {
        buf[i] = Process(buf[i]);
    }
}

attribute is gcc-specific, causes msvc to not compile, and will be ignored on clang. alternatives:

  • put unroll-loops in a macro that is empty on non-gcc platforms
  • take size as a template parameter to reliably unroll the loop at compile time, example: https://stackoverflow.com/q/67599943

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