Fix -Wundef warnings due to use of unguarded SDL_MMX_INTRINSICS

This commit is contained in:
Anonymous Maarten
2023-03-27 19:03:05 +02:00
parent 9d70a57416
commit d71daf0175
3 changed files with 10 additions and 10 deletions

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -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;