MSVC won't compile 'const float _demolition[]' because it uses 'divide by zero' while...
authorJohn Emmas <johne53@tiscali.co.uk>
Tue, 3 May 2016 16:30:58 +0000 (17:30 +0100)
committerJohn Emmas <johne53@tiscali.co.uk>
Tue, 3 May 2016 16:30:58 +0000 (17:30 +0100)
Hopefully we can use INFINITY and NAN for the relevant initializers ?

libs/backends/dummy/dummy_audiobackend.cc
msvc_extra_headers/ardourext/misc.h.input

index b1e67982dc64934a28ca00f4909c671642fa9b2c..069c3938829c7a00b0b7ef215aebddc0c339f5e4 100644 (file)
@@ -17,6 +17,7 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#include <math.h>
 #include <sys/time.h>
 #include <regex.h>
 #include <stdlib.h>
@@ -1801,10 +1802,10 @@ static const float _demolition[] = {
         4294967395.0f,  /* 2^16 + 100 */
        -4294967395.0f,
         HUGE,           /* Big, non-inf number */
-        1.f/0.f,        /* +inf */
-       -1.f/0.f,        /* -inf */
-       -0.f/0.f,        /* -nan */
-        0.f/0.f,        /*  nan */
+        INFINITY,       /* +inf */
+       -INFINITY,       /* -inf */
+       -NAN,            /* -nan */
+        NAN,            /*  nan */
         0.0f,           /* some silence to check for recovery */
 };
 
index 9bcba6f327dacd8d13762db2f0bd815ae9c42674..161ed167f171ffbe63f021be022771dca79e3f6d 100644 (file)
 #define INFINITY    HUGE_VAL
 #endif
 
+#ifndef NAN
+#define NAN        _NANCODE
+#endif
+
 // File access modes copied from unistd.h
 #define F_OK 0
 #define R_OK 4