'gtk2_ardour' - 'std::isinf' + 'std::isnan' are not available in MSVC (at least,...
authorJohn Emmas <johne53@tiscali.co.uk>
Thu, 3 Oct 2013 08:48:19 +0000 (09:48 +0100)
committerJohn Emmas <johne53@tiscali.co.uk>
Thu, 3 Oct 2013 08:48:19 +0000 (09:48 +0100)
gtk2_ardour/automation_line.cc
gtk2_ardour/plugin_eq_gui.cc

index 17e07924778ff40e45aa38eefa35a0f2f1b4e6ff..94ca7802f056adc09697ce974b1647d8f719175e 100644 (file)
 
 */
 
+#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 <climits>
 #include <vector>
@@ -933,7 +944,7 @@ AutomationLine::reset_callback (const Evoral::ControlList& events)
 
                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\""),
                                                   _name) << endmsg;
                        continue;
index 631fb7be716f50d17993048ce134b3e51cc8b7f5..4bf2a5f87913e8143b67c0bc9aa61446c84e9632 100644 (file)
 
 */
 
+#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 "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) {
                                power = _min_dB - 1.0;
                        } else {
                                power = _max_dB - 1.0;
                        }
-               } else if (std::isnan(power)) {
+               } else if (isnan(power)) {
                        power = _min_dB - 1.0;
                }