From d71daf01757c883d637cd9fa6c1e8b10471b4ef5 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Mon, 27 Mar 2023 19:03:05 +0200 Subject: [PATCH] Fix -Wundef warnings due to use of unguarded SDL_MMX_INTRINSICS --- src/video/SDL_blit_A.c | 12 ++++++------ src/video/SDL_blit_copy.c | 4 ++-- test/testautomation_intrinsics.c | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/video/SDL_blit_A.c b/src/video/SDL_blit_A.c index d4446b4dec..5ae6c88f96 100644 --- a/src/video/SDL_blit_A.c +++ b/src/video/SDL_blit_A.c @@ -166,7 +166,7 @@ static void BlitNto1SurfaceAlphaKey(SDL_BlitInfo *info) } } -#if SDL_MMX_INTRINSICS +#if defined(SDL_MMX_INTRINSICS) /* fast RGB888->(A)RGB888 blending with surface alpha=128 special case */ static void SDL_TARGETING("mmx") BlitRGBtoRGBSurfaceAlpha128MMX(SDL_BlitInfo *info) @@ -750,7 +750,7 @@ static void Blit16to16SurfaceAlpha128(SDL_BlitInfo *info, Uint16 mask) } } -#if SDL_MMX_INTRINSICS +#if defined(SDL_MMX_INTRINSICS) /* fast RGB565->RGB565 blending with surface alpha */ static void SDL_TARGETING("mmx") Blit565to565SurfaceAlphaMMX(SDL_BlitInfo *info) @@ -1360,7 +1360,7 @@ SDL_CalculateBlitA(SDL_Surface *surface) case 4: if (sf->Rmask == df->Rmask && sf->Gmask == df->Gmask && sf->Bmask == df->Bmask && sf->BytesPerPixel == 4) { -#if SDL_MMX_INTRINSICS +#if defined(SDL_MMX_INTRINSICS) if (sf->Rshift % 8 == 0 && sf->Gshift % 8 == 0 && sf->Bshift % 8 == 0 && sf->Ashift % 8 == 0 && sf->Aloss == 0) { if (SDL_HasMMX()) { return BlitRGBtoRGBPixelAlphaMMX; @@ -1408,7 +1408,7 @@ SDL_CalculateBlitA(SDL_Surface *surface) case 2: if (surface->map->identity) { if (df->Gmask == 0x7e0) { -#if SDL_MMX_INTRINSICS +#if defined(SDL_MMX_INTRINSICS) if (SDL_HasMMX()) { return Blit565to565SurfaceAlphaMMX; } else @@ -1417,7 +1417,7 @@ SDL_CalculateBlitA(SDL_Surface *surface) return Blit565to565SurfaceAlpha; } } else if (df->Gmask == 0x3e0) { -#if SDL_MMX_INTRINSICS +#if defined(SDL_MMX_INTRINSICS) if (SDL_HasMMX()) { return Blit555to555SurfaceAlphaMMX; } else @@ -1431,7 +1431,7 @@ SDL_CalculateBlitA(SDL_Surface *surface) case 4: if (sf->Rmask == df->Rmask && sf->Gmask == df->Gmask && sf->Bmask == df->Bmask && sf->BytesPerPixel == 4) { -#if SDL_MMX_INTRINSICS +#if defined(SDL_MMX_INTRINSICS) if (sf->Rshift % 8 == 0 && sf->Gshift % 8 == 0 && sf->Bshift % 8 == 0 && SDL_HasMMX()) { return BlitRGBtoRGBSurfaceAlphaMMX; } diff --git a/src/video/SDL_blit_copy.c b/src/video/SDL_blit_copy.c index f62be5380e..30abf8e952 100644 --- a/src/video/SDL_blit_copy.c +++ b/src/video/SDL_blit_copy.c @@ -50,7 +50,7 @@ static SDL_INLINE void SDL_TARGETING("sse") SDL_memcpySSE(Uint8 *dst, const Uint } #endif /* SDL_SSE_INTRINSICS */ -#if SDL_MMX_INTRINSICS +#if defined(SDL_MMX_INTRINSICS) #ifdef _MSC_VER #pragma warning(disable : 4799) #endif @@ -149,7 +149,7 @@ void SDL_BlitCopy(SDL_BlitInfo *info) } #endif -#if SDL_MMX_INTRINSICS +#if defined(SDL_MMX_INTRINSICS) if (SDL_HasMMX() && !(srcskip & 7) && !(dstskip & 7)) { SDL_BlitCopyMMX(dst, src, dstskip, srcskip, w, h); return; diff --git a/test/testautomation_intrinsics.c b/test/testautomation_intrinsics.c index fae6ca8242..7371cab8fa 100644 --- a/test/testautomation_intrinsics.c +++ b/test/testautomation_intrinsics.c @@ -193,7 +193,7 @@ static void kernel_doubles_add_cpu(double *dest, const double *a, const double * } } -#if SDL_MMX_INTRINSICS +#if defined(SDL_MMX_INTRINSICS) SDL_TARGETING("mmx") static void kernel_ints_add_mmx(Sint32 *dest, const Sint32 *a, const Sint32 *b, size_t size) { for (; size >= 2; size -= 2, dest += 2, a += 2, b += 2) { *(__m64*)dest = _mm_add_pi32(*(__m64*)a, *(__m64*)b); @@ -364,7 +364,7 @@ static int intrinsics_testMMX(void *arg) { if (SDL_HasMMX()) { SDLTest_AssertCheck(SDL_TRUE, "CPU of test machine has MMX support."); -#if SDL_MMX_INTRINSICS +#if defined(SDL_MMX_INTRINSICS) { size_t size; Sint32 *dest, *a, *b;