ValleyRackFree icon indicating copy to clipboard operation
ValleyRackFree copied to clipboard

error: use of undeclared identifier 'aligned_alloc_16'

Open yurivict opened this issue 4 years ago • 2 comments

Build fails on FreeBSD:

ValleyAudio/src/Dexter/Dexter.cpp:184:24: error: use of undeclared identifier 'aligned_alloc_16'
    pOpFreqs = (float*)aligned_alloc_16(sizeof(float) * 8);
                       ^

aligned_alloc_16 isn't standard. The standard defines only aligned_alloc.

yurivict avatar Jan 30 '22 18:01 yurivict

Hey, thanks for trying to build it on FreeBSD. aligned_alloc_16() is a wrapper function that is defined in src/Common/SIMD/SIMDUtilities.hpp for the different aligned memory allocation functions on different OS's. It's not perfect.

Now Rack only supports C++11 which aligned_alloc() is not entirely standard, even if it is standard in C11. I went with malloc() for macOS, and _aligned_malloc for Windows since clang and MSVC don't feature aligned_alloc(), yet they guarantee 16-byte alignment.

ValleyAudio avatar Feb 19 '22 21:02 ValleyAudio

It's built as part of Cardinal.

I had to patch out aligned_alloc_16() and similar for build to succeed.

yurivict avatar Feb 19 '22 21:02 yurivict