diff --git a/tests/Makefile b/tests/Makefile index c935b00..cba1143 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -1,5 +1,5 @@ -CXXFLAGS = -I.. -std=c++17 -W -Wall -Ofast -fno-exceptions -fno-rtti -march=native +CXXFLAGS = -I.. -std=c++11 -W -Wall -Ofast -fno-exceptions -fno-rtti -march=native CXX = clang++ -stdlib=libc++ #CXX = g++ diff --git a/wav.hh b/wav.hh index 39043c4..9786502 100644 --- a/wav.hh +++ b/wav.hh @@ -206,7 +206,7 @@ public: for (int n = 0; n < num; ++n) { for (int c = 0; c < channels_; ++c) { TYPE v = TYPE(offset) + TYPE(factor) * buf[stride * n + c]; - writeLE(std::nearbyint(std::clamp(v, TYPE(min), TYPE(max))), bytes); + writeLE(std::nearbyint(std::min(std::max(v, TYPE(min)), TYPE(max))), bytes); } } }