mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 23:35:03 +01:00
'gtk2_ardour' - 'std::isinf' + 'std::isnan' are not available in MSVC (at least, not VC8)
This commit is contained in:
parent
f763e370c5
commit
904367748c
2 changed files with 25 additions and 3 deletions
|
|
@ -17,6 +17,17 @@
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef COMPILER_MSVC
|
||||||
|
#include <float.h>
|
||||||
|
|
||||||
|
// 'std::isinf()' and 'std::isnan()' are not available in MSVC.
|
||||||
|
#define isinf(val) !((bool)_finite((double)val))
|
||||||
|
#define isnan(val) (bool)_isnan((double)val)
|
||||||
|
#else
|
||||||
|
using std::isnan;
|
||||||
|
using std::isinf;
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <climits>
|
#include <climits>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
@ -933,7 +944,7 @@ AutomationLine::reset_callback (const Evoral::ControlList& events)
|
||||||
|
|
||||||
model_to_view_coord (tx, ty);
|
model_to_view_coord (tx, ty);
|
||||||
|
|
||||||
if (std::isnan (tx) || std::isnan (ty)) {
|
if (isnan (tx) || isnan (ty)) {
|
||||||
warning << string_compose (_("Ignoring illegal points on AutomationLine \"%1\""),
|
warning << string_compose (_("Ignoring illegal points on AutomationLine \"%1\""),
|
||||||
_name) << endmsg;
|
_name) << endmsg;
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,17 @@
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef COMPILER_MSVC
|
||||||
|
#include <float.h>
|
||||||
|
|
||||||
|
// 'std::isinf()' and 'std::isnan()' are not available in MSVC.
|
||||||
|
#define isinf(val) !((bool)_finite((double)val))
|
||||||
|
#define isnan(val) (bool)_isnan((double)val)
|
||||||
|
#else
|
||||||
|
using std::isnan;
|
||||||
|
using std::isinf;
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "plugin_eq_gui.h"
|
#include "plugin_eq_gui.h"
|
||||||
#include "fft.h"
|
#include "fft.h"
|
||||||
|
|
||||||
|
|
@ -765,13 +776,13 @@ PluginEqGui::plot_signal_amplitude_difference(Gtk::Widget *w, cairo_t *cr)
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (std::isinf(power)) {
|
if (isinf(power)) {
|
||||||
if (power < 0) {
|
if (power < 0) {
|
||||||
power = _min_dB - 1.0;
|
power = _min_dB - 1.0;
|
||||||
} else {
|
} else {
|
||||||
power = _max_dB - 1.0;
|
power = _max_dB - 1.0;
|
||||||
}
|
}
|
||||||
} else if (std::isnan(power)) {
|
} else if (isnan(power)) {
|
||||||
power = _min_dB - 1.0;
|
power = _min_dB - 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue