From b88a7baf346f8a0016df51c72e93fe3b23fa80d0 Mon Sep 17 00:00:00 2001 From: Ralph Giles <giles@mozilla.com> Date: Fri, 28 Oct 2011 09:21:08 -0700 Subject: [PATCH] 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. --- tests/test_opus_api.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/test_opus_api.c b/tests/test_opus_api.c index 4246d16fd..a04c75648 100644 --- a/tests/test_opus_api.c +++ b/tests/test_opus_api.c @@ -1165,7 +1165,10 @@ int test_repacketizer_api(void) * 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,8 +1257,11 @@ int test_malloc_fail(void) } #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) { -- GitLab