From 9d70a57416872fbe336a3d1d386a2b520fa756ce Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Mon, 27 Mar 2023 19:01:40 +0200 Subject: [PATCH] Fix -Wundef warnings due to use of unguarded SDL_SSE_INTRINSICS --- src/audio/SDL_audiocvt.c | 4 ++-- src/video/SDL_blit_copy.c | 4 ++-- src/video/SDL_fillrect.c | 8 ++++---- test/testautomation_intrinsics.c | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/audio/SDL_audiocvt.c b/src/audio/SDL_audiocvt.c index 3d6debb5b5..a5439677d5 100644 --- a/src/audio/SDL_audiocvt.c +++ b/src/audio/SDL_audiocvt.c @@ -181,7 +181,7 @@ static void SDLCALL SDL_TARGETING("sse3") SDL_ConvertStereoToMono_SSE3(SDL_Audio } #endif -#if SDL_SSE_INTRINSICS +#if defined(SDL_SSE_INTRINSICS) /* Convert from mono to stereo. Duplicate to stereo left and right. */ static void SDLCALL SDL_TARGETING("sse") SDL_ConvertMonoToStereo_SSE(SDL_AudioCVT *cvt, SDL_AudioFormat format) { @@ -842,7 +842,7 @@ static int SDL_BuildAudioCVT(SDL_AudioCVT *cvt, } } else if (channel_converter == SDL_ConvertMonoToStereo) { SDL_AudioFilter filter = NULL; -#if SDL_SSE_INTRINSICS +#if defined(SDL_SSE_INTRINSICS) if (!filter && SDL_HasSSE()) { filter = SDL_ConvertMonoToStereo_SSE; } diff --git a/src/video/SDL_blit_copy.c b/src/video/SDL_blit_copy.c index 2c34a8362c..f62be5380e 100644 --- a/src/video/SDL_blit_copy.c +++ b/src/video/SDL_blit_copy.c @@ -23,7 +23,7 @@ #include "SDL_blit.h" #include "SDL_blit_copy.h" -#if SDL_SSE_INTRINSICS +#if defined(SDL_SSE_INTRINSICS) /* This assumes 16-byte aligned src and dst */ static SDL_INLINE void SDL_TARGETING("sse") SDL_memcpySSE(Uint8 *dst, const Uint8 *src, int len) { @@ -136,7 +136,7 @@ void SDL_BlitCopy(SDL_BlitInfo *info) return; } -#if SDL_SSE_INTRINSICS +#if defined(SDL_SSE_INTRINSICS) if (SDL_HasSSE() && !((uintptr_t)src & 15) && !(srcskip & 15) && !((uintptr_t)dst & 15) && !(dstskip & 15)) { diff --git a/src/video/SDL_fillrect.c b/src/video/SDL_fillrect.c index 955fead0b9..7f9f91a7b5 100644 --- a/src/video/SDL_fillrect.c +++ b/src/video/SDL_fillrect.c @@ -22,7 +22,7 @@ #include "SDL_blit.h" -#if SDL_SSE_INTRINSICS +#if defined(SDL_SSE_INTRINSICS) /* *INDENT-OFF* */ /* clang-format off */ #if defined(_MSC_VER) && !defined(__clang__) @@ -376,7 +376,7 @@ int SDL_FillSurfaceRects(SDL_Surface *dst, const SDL_Rect *rects, int count, { color |= (color << 8); color |= (color << 16); -#if SDL_SSE_INTRINSICS +#if defined(SDL_SSE_INTRINSICS) if (SDL_HasSSE()) { fill_function = SDL_FillSurfaceRect1SSE; break; @@ -389,7 +389,7 @@ int SDL_FillSurfaceRects(SDL_Surface *dst, const SDL_Rect *rects, int count, case 2: { color |= (color << 16); -#if SDL_SSE_INTRINSICS +#if defined(SDL_SSE_INTRINSICS) if (SDL_HasSSE()) { fill_function = SDL_FillSurfaceRect2SSE; break; @@ -408,7 +408,7 @@ int SDL_FillSurfaceRects(SDL_Surface *dst, const SDL_Rect *rects, int count, case 4: { -#if SDL_SSE_INTRINSICS +#if defined(SDL_SSE_INTRINSICS) if (SDL_HasSSE()) { fill_function = SDL_FillSurfaceRect4SSE; break; diff --git a/test/testautomation_intrinsics.c b/test/testautomation_intrinsics.c index 91bc76c68a..fae6ca8242 100644 --- a/test/testautomation_intrinsics.c +++ b/test/testautomation_intrinsics.c @@ -205,7 +205,7 @@ SDL_TARGETING("mmx") static void kernel_ints_add_mmx(Sint32 *dest, const Sint32 } #endif -#if SDL_SSE_INTRINSICS +#if defined(SDL_SSE_INTRINSICS) SDL_TARGETING("sse") static void kernel_floats_add_sse(float *dest, const float *a, const float *b, size_t size) { for (; size >= 4; size -= 4, dest += 4, a += 4, b += 4) { _mm_storeu_ps(dest, _mm_add_ps(_mm_loadu_ps(a), _mm_loadu_ps (b))); @@ -392,7 +392,7 @@ static int intrinsics_testSSE(void *arg) { if (SDL_HasSSE()) { SDLTest_AssertCheck(SDL_TRUE, "CPU of test machine has SSE support."); -#if SDL_SSE_INTRINSICS +#if defined(SDL_SSE_INTRINSICS) { size_t size; float *dest, *a, *b;