shithub: opus

Download patch

ref: b88a7baf346f8a0016df51c72e93fe3b23fa80d0
parent: c19bc346386544574bae65e7979ae94603688496
author: Ralph Giles <giles@mozilla.com>
date: Fri Oct 28 05:21:08 EDT 2011

Use #pragma GCC diagnostic push/pop only on gcc 4.6 and later.

These pragmas were adding in 4.6, and earlier versions warn
about them being undefined.

--- a/tests/test_opus_api.c
+++ b/tests/test_opus_api.c
@@ -1165,7 +1165,10 @@
  * 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
+/* Save the current warning settings */
 #pragma GCC diagnostic push
+#endif
 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 
 typedef void *(*mhook)(size_t __size, __const __malloc_ptr_t);
@@ -1254,7 +1257,10 @@
 }
 
 #ifdef MALLOC_FAIL
+#if defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 6
+/* Restore the previous warning settings */
 #pragma GCC diagnostic pop /* restore -Wdeprecated-declarations */
+#endif
 #endif
 
 int main(int _argc, char **_argv)