From cf85710cf84707797bde8c7da1307014e0b335eb Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Wed, 28 Jul 2021 22:55:10 +0300 Subject: [PATCH] SDL_audiocvt.c: disable AVX for clang < 5 and gcc < 4.9 See: https://github.com/libsdl-org/SDL/issues/4533 --- src/audio/SDL_audiocvt.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/audio/SDL_audiocvt.c b/src/audio/SDL_audiocvt.c index 23d1906d7..97f10dfbf 100644 --- a/src/audio/SDL_audiocvt.c +++ b/src/audio/SDL_audiocvt.c @@ -46,6 +46,15 @@ #if defined(HAVE_IMMINTRIN_H) && !defined(SDL_DISABLE_IMMINTRIN_H) #define HAVE_AVX_INTRINSICS 1 #endif +#if defined __clang__ +# if (__clang_major__ < 5) +# undef HAVE_AVX_INTRINSICS +# endif +#elif defined __GNUC__ +# if (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 9) +# undef HAVE_AVX_INTRINSICS +# endif +#endif #if HAVE_SSE3_INTRINSICS /* Convert from stereo to mono. Average left and right. */