diff options
author | Ralph Giles <giles@mozilla.com> | 2011-10-28 09:21:08 -0700 |
---|---|---|
committer | Ralph Giles <giles@mozilla.com> | 2011-10-28 10:20:16 -0700 |
commit | b88a7baf346f8a0016df51c72e93fe3b23fa80d0 (patch) | |
tree | 496dc23ec0ebdbbf5be279d4db88b9469fafa662 /tests | |
parent | c19bc346386544574bae65e7979ae94603688496 (diff) | |
download | opus-b88a7baf346f8a0016df51c72e93fe3b23fa80d0.tar.gz |
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.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_opus_api.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test_opus_api.c b/tests/test_opus_api.c index 4246d16f..a04c7564 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) { |