]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-9152 [avmd] #fix warnings on FreeBSD
authorPiotr Gregor <piotrek.gregor@gmail.com>
Thu, 12 May 2016 00:09:12 +0000 (01:09 +0100)
committerPiotr Gregor <piotrek.gregor@gmail.com>
Thu, 12 May 2016 01:24:14 +0000 (02:24 +0100)
Use function __isnan to avoid __Generic
type extension on FreeBSD. Clang 3.4.1 complains
about -Wc++11-extensions even when it has them
defined.

src/mod/applications/mod_avmd/avmd_desa2.c
src/mod/applications/mod_avmd/avmd_desa2_tweaked.c
src/mod/applications/mod_avmd/mod_avmd.c

index abecf6ee644e22bfaaf15d9f4dd1df828dd29d4c..b1d19eb8ae5bddf001efe2f7281c6750e74655c8 100644 (file)
@@ -5,8 +5,11 @@
 #ifdef WIN32
 #include <float.h>
 #define ISNAN(x) (!!(_isnan(x)))
+#define ISINF(x) (isinf(x))
 #else
-#define ISNAN(x) (isnan(x))
+int __isnan(double);
+#define ISNAN(x) (__isnan(x))
+#define ISINF(x) (__isinf(x))
 #endif
 #include "avmd_buffer.h"
 #include "avmd_desa2.h"
index 0b75b9eed1320890b2fe885417cb86ec42c8f11f..8eae1753f3358eaef8bc62842da0b72651a33ca3 100644 (file)
@@ -5,8 +5,11 @@
 #ifdef WIN32
 #include <float.h>
 #define ISNAN(x) (!!(_isnan(x)))
+#define ISINF(x) (isinf(x))
 #else
-#define ISNAN(x) (isnan(x))
+int __isnan(double);
+#define ISNAN(x) (__isnan(x))
+#define ISINF(x) (__isinf(x))
 #endif
 #include "avmd_buffer.h"
 #include "avmd_desa2_tweaked.h"
@@ -48,7 +51,7 @@ avmd_desa2_tweaked(circ_buffer_t *b, size_t i)
  we do simplified, modified for speed version : */
 
     result = n/d;
-    if (isinf(result)) {
+    if (ISINF(result)) {
         if (n < 0.0)
             return -10.0;
         else
index 75c432ec618c70f3e524241768abaa71624fe202..de896e8fbb1425a975e08c26a6816ca487142922 100644 (file)
 #ifdef WIN32
 #include <float.h>
 #define ISNAN(x) (!!(_isnan(x)))
+#define ISINF(x) (isinf(x))
 #else
-#define ISNAN(x) (isnan(x))
+int __isnan(double);
+#define ISNAN(x) (__isnan(x))
+#define ISINF(x) (__isinf(x))
 #endif
 
 
@@ -1471,7 +1474,7 @@ static void avmd_process(avmd_session_t *s, switch_frame_t *frame)
                 sample_to_skip_n = AVMD_SAMLPE_TO_SKIP_N;
 #endif
                        } else {
-                if (isnan(omega)) {
+                if (ISNAN(omega)) {
 #ifdef AVMD_DEBUG
                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(s->session),
                             SWITCH_LOG_DEBUG, "<<< AVMD, SKIP NaN >>>\n");