From b4dd4eb7809f5635bcd432beb2f58d18757db3df Mon Sep 17 00:00:00 2001 From: Ralph Giles <giles@thaumas.net> Date: Fri, 28 Oct 2011 10:51:17 -0700 Subject: [PATCH] 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. --- tests/test_opus_api.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/test_opus_api.c b/tests/test_opus_api.c index 1bc26ff0e..76ae3b164 100644 --- 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 @@ 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 +#if defined(__GNUC_PREREQ) && __GNUC_PREREQ(4,6) /* Save the current warning settings */ #pragma GCC diagnostic push #endif @@ -1259,7 +1260,7 @@ int test_malloc_fail(void) } #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 -- GitLab