Use -fsingle-precision-constant for MOD builds

Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
falkTX 2022-01-26 21:57:02 +00:00
parent 8d9acc3d65
commit 14a2cb153e
No known key found for this signature in database
GPG key ID: CDBAA37ABC74FBA0
4 changed files with 65 additions and 3 deletions

View file

@ -0,0 +1,46 @@
/*
* DISTRHO Cardinal Plugin
* Copyright (C) 2021-2022 Filipe Coelho <falktx@falktx.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 3 of
* the License, or any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* For a full copy of the GNU General Public License see the LICENSE file.
*/
#pragma once
#include_next <algorithm>
#include_next <complex>
namespace std {
static inline
float max(const float a, const double b) {
return std::max<float>(a, static_cast<float>(b));
}
static inline
std::complex<float> operator*(const std::complex<double>& a, const float b) {
return static_cast<std::complex<float>>(a) * b;
}
static inline
std::complex<float> operator*(const float a, const std::complex<double>& b) {
return a * static_cast<std::complex<float>>(b);
}
static inline
std::complex<float> operator/(const std::complex<double>& a, const std::complex<float>& b) {
return static_cast<std::complex<float>>(a) / b;
}
}
// std::complex<double>