From f937e01261eadb4dc1693615156de1b657a9b7ce Mon Sep 17 00:00:00 2001 From: James Zern Date: Thu, 24 Apr 2014 20:38:28 -0700 Subject: [PATCH] move LOCAL_GCC_VERSION def to dsp.h + add LOCAL_GCC_PREREQ and use it in lossless_neon.c Change-Id: Ic9fd99540bc3e19c027d1598e4530dfdc9b9de00 --- src/dsp/dsp.h | 8 ++++++++ src/dsp/lossless_neon.c | 6 +----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/dsp/dsp.h b/src/dsp/dsp.h index 41d48a88..0852f616 100644 --- a/src/dsp/dsp.h +++ b/src/dsp/dsp.h @@ -23,6 +23,14 @@ extern "C" { //------------------------------------------------------------------------------ // CPU detection +#if defined(__GNUC__) +# define LOCAL_GCC_VERSION ((__GNUC__ << 8) | __GNUC_MINOR__) +# define LOCAL_GCC_PREREQ(maj, min) \ + (LOCAL_GCC_VERSION >= (((maj) << 8) | (min))) +#else +# define LOCAL_GCC_PREREQ(maj, min) 0 +#endif + #if defined(_MSC_VER) && _MSC_VER > 1310 && \ (defined(_M_X64) || defined(_M_IX86)) #define WEBP_MSC_SSE2 // Visual C++ SSE2 targets diff --git a/src/dsp/lossless_neon.c b/src/dsp/lossless_neon.c index 680bcfe2..d0ae21c9 100644 --- a/src/dsp/lossless_neon.c +++ b/src/dsp/lossless_neon.c @@ -26,11 +26,7 @@ //------------------------------------------------------------------------------ // Colorspace conversion functions -#if defined(__GNUC__) -#define LOCAL_GCC_VERSION ((__GNUC__ << 8) | __GNUC_MINOR__) -#endif - -#if defined(LOCAL_GCC_VERSION) && (LOCAL_GCC_VERSION >= 0x408) +#if LOCAL_GCC_PREREQ(4,8) // gcc 4.6.0 had some trouble (NDK-r9) with this code. We only use it for // gcc-4.8.x at least. static void ConvertBGRAToRGBA(const uint32_t* src,