shithub: opus

Download patch

ref: b4dd4eb7809f5635bcd432beb2f58d18757db3df
parent: 732ac84452097cf8b0c5749c62229b17ec332aa6
author: Ralph Giles <[email protected]>
date: Fri Oct 28 06:51:17 EDT 2011

Fix the test for gcc version >= 4.6 to work for gcc 5 and up.

We use the __GNUC_PREREQ macro from celt/arch.h to check
the required minimum gcc version. The previous check would
have failed for gcc 5.n with n from 0 to 5.

Thanks to pcgod for pointing out the problem and derf for
pointing out we had a macro for this.

--- a/tests/test_opus_api.c
+++ b/tests/test_opus_api.c
@@ -49,6 +49,7 @@
 #include <stdlib.h>
 #include <stdint.h>
 #include <string.h>
+#include "arch.h"
 #include "../include/opus.h"
 #include "test_opus_common.h"
 
@@ -1167,7 +1168,7 @@
  * handling in our codebase, and the lack of thread saftey isn't an
  * issue here. We therefore disable the warning for this function.
  */
-#if defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 6
+#if defined(__GNUC_PREREQ) && __GNUC_PREREQ(4,6)
 /* Save the current warning settings */
 #pragma GCC diagnostic push
 #endif
@@ -1259,7 +1260,7 @@
 }
 
 #ifdef MALLOC_FAIL
-#if defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 6
+#if defined(__GNUC_PREREQ) && __GNUC_PREREQ(4,6)
 /* Restore the previous warning settings */
 #pragma GCC diagnostic pop /* restore -Wdeprecated-declarations */
 #endif