From 18fe2e2c4ec589d166b8c54a3dba936ed172d805 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 27 Dec 2021 16:30:39 +0100 Subject: [PATCH] Fix C++11/14 array initialization (clang < 3.7) C++11 array initialization won't call copy constructor, leading to an error: array initializer must be an initializer list. Specifically this affects the copy c'tor: line 93: peaks (other.peaks) A workaround is to use a vector instead of a fixed size array. This fixes macOS builds. --- libs/ardour/ardour/export_analysis.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/ardour/ardour/export_analysis.h b/libs/ardour/ardour/export_analysis.h index 9bebf53cd6..903834d16c 100644 --- a/libs/ardour/ardour/export_analysis.h +++ b/libs/ardour/ardour/export_analysis.h @@ -52,6 +52,7 @@ public: b = std::max (100, b); width = std::max (800, width); + peaks.resize (2); peaks[0].resize (w); peaks[1].resize (width); spectrum.resize (width); @@ -135,8 +136,8 @@ public: uint32_t n_samples; uint32_t freq[6]; // y-pos, 50, 100, 500, 1k, 5k, 10k [Hz] - std::vector peaks[2]; - std::vector> spectrum; + std::vector > peaks; + std::vector > spectrum; float* lgraph_i; float* lgraph_s;