From 043dd37f5f850efb12d4c6139b3fe317a747f105 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Mon, 27 Mar 2023 16:01:49 +0200 Subject: [PATCH] Fix -Wundef warnings due to use of unguarded SDL_ARM_SIMD_BLITTERS --- src/video/SDL_blit_A.c | 8 ++++---- src/video/SDL_blit_N.c | 6 +++--- src/video/SDL_fillrect.c | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/video/SDL_blit_A.c b/src/video/SDL_blit_A.c index 7494438fe7..0782c47031 100644 --- a/src/video/SDL_blit_A.c +++ b/src/video/SDL_blit_A.c @@ -411,7 +411,7 @@ static void SDL_TARGETING("mmx") BlitRGBtoRGBPixelAlphaMMX(SDL_BlitInfo *info) #endif /* SDL_MMX_INTRINSICS */ -#if SDL_ARM_SIMD_BLITTERS +#ifdef SDL_ARM_SIMD_BLITTERS void BlitARGBto565PixelAlphaARMSIMDAsm(int32_t w, int32_t h, uint16_t *dst, int32_t dst_stride, uint32_t *src, int32_t src_stride); static void BlitARGBto565PixelAlphaARMSIMD(SDL_BlitInfo *info) @@ -1335,14 +1335,14 @@ SDL_CalculateBlitA(SDL_Surface *surface) } case 2: -#if SDL_ARM_NEON_BLITTERS || SDL_ARM_SIMD_BLITTERS +#if SDL_ARM_NEON_BLITTERS || defined(SDL_ARM_SIMD_BLITTERS) if (sf->BytesPerPixel == 4 && sf->Amask == 0xff000000 && sf->Gmask == 0xff00 && df->Gmask == 0x7e0 && ((sf->Rmask == 0xff && df->Rmask == 0x1f) || (sf->Bmask == 0xff && df->Bmask == 0x1f))) { #if SDL_ARM_NEON_BLITTERS if (SDL_HasNEON()) { return BlitARGBto565PixelAlphaARMNEON; } #endif -#if SDL_ARM_SIMD_BLITTERS +#if defined(SDL_ARM_SIMD_BLITTERS) if (SDL_HasARMSIMD()) { return BlitARGBto565PixelAlphaARMSIMD; } @@ -1373,7 +1373,7 @@ SDL_CalculateBlitA(SDL_Surface *surface) return BlitRGBtoRGBPixelAlphaARMNEON; } #endif -#if SDL_ARM_SIMD_BLITTERS +#if defined(SDL_ARM_SIMD_BLITTERS) if (SDL_HasARMSIMD()) { return BlitRGBtoRGBPixelAlphaARMSIMD; } diff --git a/src/video/SDL_blit_N.c b/src/video/SDL_blit_N.c index d3e77b2209..7324331dc4 100644 --- a/src/video/SDL_blit_N.c +++ b/src/video/SDL_blit_N.c @@ -904,7 +904,7 @@ static enum blit_features GetBlitFeatures(void) #define GetBlitFeatures() ((SDL_HasMMX() ? BLIT_FEATURE_HAS_MMX : 0) | (SDL_HasARMSIMD() ? BLIT_FEATURE_HAS_ARM_SIMD : 0)) #endif -#if SDL_ARM_SIMD_BLITTERS +#if defined(SDL_ARM_SIMD_BLITTERS) void Blit_BGR888_RGB888ARMSIMDAsm(int32_t w, int32_t h, uint32_t *dst, int32_t dst_stride, uint32_t *src, int32_t src_stride); static void Blit_BGR888_RGB888ARMSIMD(SDL_BlitInfo *info) @@ -3221,7 +3221,7 @@ static const struct blit_table normal_blit_2[] = { { 0x00007C00, 0x000003E0, 0x0000001F, 4, 0x00000000, 0x00000000, 0x00000000, BLIT_FEATURE_HAS_ALTIVEC, Blit_RGB555_32Altivec, NO_ALPHA | COPY_ALPHA | SET_ALPHA }, #endif -#if SDL_ARM_SIMD_BLITTERS +#ifdef SDL_ARM_SIMD_BLITTERS { 0x00000F00, 0x000000F0, 0x0000000F, 4, 0x00FF0000, 0x0000FF00, 0x000000FF, BLIT_FEATURE_HAS_ARM_SIMD, Blit_RGB444_RGB888ARMSIMD, NO_ALPHA | COPY_ALPHA }, #endif @@ -3292,7 +3292,7 @@ static const struct blit_table normal_blit_4[] = { { 0x00000000, 0x00000000, 0x00000000, 2, 0x0000F800, 0x000007E0, 0x0000001F, BLIT_FEATURE_HAS_ALTIVEC, Blit_RGB888_RGB565Altivec, NO_ALPHA }, #endif -#if SDL_ARM_SIMD_BLITTERS +#ifdef SDL_ARM_SIMD_BLITTERS { 0x000000FF, 0x0000FF00, 0x00FF0000, 4, 0x00FF0000, 0x0000FF00, 0x000000FF, BLIT_FEATURE_HAS_ARM_SIMD, Blit_BGR888_RGB888ARMSIMD, NO_ALPHA | COPY_ALPHA }, #endif diff --git a/src/video/SDL_fillrect.c b/src/video/SDL_fillrect.c index e39e69e609..f7545c660c 100644 --- a/src/video/SDL_fillrect.c +++ b/src/video/SDL_fillrect.c @@ -271,7 +271,7 @@ static void fill_32_neon(Uint8 *pixels, int pitch, Uint32 color, int w, int h) } #endif -#if SDL_ARM_SIMD_BLITTERS +#ifdef SDL_ARM_SIMD_BLITTERS void FillSurfaceRect8ARMSIMDAsm(int32_t w, int32_t h, uint8_t *dst, int32_t dst_stride, uint8_t src); void FillSurfaceRect16ARMSIMDAsm(int32_t w, int32_t h, uint16_t *dst, int32_t dst_stride, uint16_t src); void FillSurfaceRect32ARMSIMDAsm(int32_t w, int32_t h, uint32_t *dst, int32_t dst_stride, uint32_t src); @@ -354,7 +354,7 @@ int SDL_FillSurfaceRects(SDL_Surface *dst, const SDL_Rect *rects, int count, } } #endif -#if SDL_ARM_SIMD_BLITTERS +#ifdef SDL_ARM_SIMD_BLITTERS if (SDL_HasARMSIMD() && dst->format->BytesPerPixel != 3 && fill_function == NULL) { switch (dst->format->BytesPerPixel) { case 1: