Fix -Wundef warnings due to use of unguarded SDL_ALTIVEC_BLITTERS

This commit is contained in:
Anonymous Maarten committed 2023-03-28 19:29:43 +02:00
1 parent 435c45b3e5
commit 2bdffd477c
2 files changed
+7 -7

No files matched your search

+3 -3
View File
@@ -42,7 +42,7 @@
#elif defined(__FreeBSD__) && defined(__powerpc__) #elif defined(__FreeBSD__) && defined(__powerpc__)
#include <machine/cpu.h> #include <machine/cpu.h>
#include <sys/auxv.h> #include <sys/auxv.h>
#elif SDL_ALTIVEC_BLITTERS && HAVE_SETJMP #elif defined(SDL_ALTIVEC_BLITTERS) && HAVE_SETJMP
#include <signal.h> #include <signal.h>
#include <setjmp.h> #include <setjmp.h>
#endif #endif
@@ -106,7 +106,7 @@
#define CPU_CFG2_LSX (1 << 6) #define CPU_CFG2_LSX (1 << 6)
#define CPU_CFG2_LASX (1 << 7) #define CPU_CFG2_LASX (1 << 7)
#if SDL_ALTIVEC_BLITTERS && HAVE_SETJMP && !__MACOS__ && !__OpenBSD__ && !__FreeBSD__ #if defined(SDL_ALTIVEC_BLITTERS) && HAVE_SETJMP && !__MACOS__ && !__OpenBSD__ && !__FreeBSD__
/* This is the brute force way of detecting instruction sets... /* This is the brute force way of detecting instruction sets...
the idea is borrowed from the libmpeg2 library - thanks! the idea is borrowed from the libmpeg2 library - thanks!
*/ */
@@ -335,7 +335,7 @@ static int CPU_haveAltiVec(void)
elf_aux_info(AT_HWCAP, &cpufeatures, sizeof(cpufeatures)); elf_aux_info(AT_HWCAP, &cpufeatures, sizeof(cpufeatures));
altivec = cpufeatures & PPC_FEATURE_HAS_ALTIVEC; altivec = cpufeatures & PPC_FEATURE_HAS_ALTIVEC;
return altivec; return altivec;
#elif SDL_ALTIVEC_BLITTERS && HAVE_SETJMP #elif defined(SDL_ALTIVEC_BLITTERS) && HAVE_SETJMP
void (*handler)(int sig); void (*handler)(int sig);
handler = signal(SIGILL, illegal_instruction); handler = signal(SIGILL, illegal_instruction);
if (setjmp(jmpbuf) == 0) { if (setjmp(jmpbuf) == 0) {
+4 -4
View File
@@ -45,7 +45,7 @@ enum blit_features
BLIT_FEATURE_HAS_ARM_SIMD = 8 BLIT_FEATURE_HAS_ARM_SIMD = 8
}; };
#if SDL_ALTIVEC_BLITTERS #ifdef SDL_ALTIVEC_BLITTERS
#ifdef __MACOS__ #ifdef __MACOS__
#include <sys/sysctl.h> #include <sys/sysctl.h>
static size_t static size_t
@@ -3214,7 +3214,7 @@ static const struct blit_table normal_blit_1[] = {
}; };
static const struct blit_table normal_blit_2[] = { static const struct blit_table normal_blit_2[] = {
#if SDL_ALTIVEC_BLITTERS #ifdef SDL_ALTIVEC_BLITTERS
/* has-altivec */ /* has-altivec */
{ 0x0000F800, 0x000007E0, 0x0000001F, 4, 0x00000000, 0x00000000, 0x00000000, { 0x0000F800, 0x000007E0, 0x0000001F, 4, 0x00000000, 0x00000000, 0x00000000,
BLIT_FEATURE_HAS_ALTIVEC, Blit_RGB565_32Altivec, NO_ALPHA | COPY_ALPHA | SET_ALPHA }, BLIT_FEATURE_HAS_ALTIVEC, Blit_RGB565_32Altivec, NO_ALPHA | COPY_ALPHA | SET_ALPHA },
@@ -3281,7 +3281,7 @@ static const struct blit_table normal_blit_3[] = {
}; };
static const struct blit_table normal_blit_4[] = { static const struct blit_table normal_blit_4[] = {
#if SDL_ALTIVEC_BLITTERS #ifdef SDL_ALTIVEC_BLITTERS
/* has-altivec | dont-use-prefetch */ /* has-altivec | dont-use-prefetch */
{ 0x00000000, 0x00000000, 0x00000000, 4, 0x00000000, 0x00000000, 0x00000000, { 0x00000000, 0x00000000, 0x00000000, 4, 0x00000000, 0x00000000, 0x00000000,
BLIT_FEATURE_HAS_ALTIVEC | BLIT_FEATURE_ALTIVEC_DONT_USE_PREFETCH, ConvertAltivec32to32_noprefetch, NO_ALPHA | COPY_ALPHA | SET_ALPHA }, BLIT_FEATURE_HAS_ALTIVEC | BLIT_FEATURE_ALTIVEC_DONT_USE_PREFETCH, ConvertAltivec32to32_noprefetch, NO_ALPHA | COPY_ALPHA | SET_ALPHA },
@@ -3431,7 +3431,7 @@ SDL_CalculateBlitN(SDL_Surface *surface)
} else if (dstfmt->BytesPerPixel == 1) { } else if (dstfmt->BytesPerPixel == 1) {
return BlitNto1Key; return BlitNto1Key;
} else { } else {
#if SDL_ALTIVEC_BLITTERS #ifdef SDL_ALTIVEC_BLITTERS
if ((srcfmt->BytesPerPixel == 4) && (dstfmt->BytesPerPixel == 4) && SDL_HasAltiVec()) { if ((srcfmt->BytesPerPixel == 4) && (dstfmt->BytesPerPixel == 4) && SDL_HasAltiVec()) {
return Blit32to32KeyAltivec; return Blit32to32KeyAltivec;
} else } else