Fix -Wundef warnings due to use of unguarded SDL_ALTIVEC_BLITTERS

This commit is contained in:
Anonymous Maarten
2023-03-27 15:16:20 +02:00
parent 435c45b3e5
commit 2bdffd477c
2 changed files with 7 additions and 7 deletions

View File

@@ -42,7 +42,7 @@
#elif defined(__FreeBSD__) && defined(__powerpc__)
#include <machine/cpu.h>
#include <sys/auxv.h>
#elif SDL_ALTIVEC_BLITTERS && HAVE_SETJMP
#elif defined(SDL_ALTIVEC_BLITTERS) && HAVE_SETJMP
#include <signal.h>
#include <setjmp.h>
#endif
@@ -106,7 +106,7 @@
#define CPU_CFG2_LSX (1 << 6)
#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...
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));
altivec = cpufeatures & PPC_FEATURE_HAS_ALTIVEC;
return altivec;
#elif SDL_ALTIVEC_BLITTERS && HAVE_SETJMP
#elif defined(SDL_ALTIVEC_BLITTERS) && HAVE_SETJMP
void (*handler)(int sig);
handler = signal(SIGILL, illegal_instruction);
if (setjmp(jmpbuf) == 0) {

View File

@@ -45,7 +45,7 @@ enum blit_features
BLIT_FEATURE_HAS_ARM_SIMD = 8
};
#if SDL_ALTIVEC_BLITTERS
#ifdef SDL_ALTIVEC_BLITTERS
#ifdef __MACOS__
#include <sys/sysctl.h>
static size_t
@@ -3214,7 +3214,7 @@ static const struct blit_table normal_blit_1[] = {
};
static const struct blit_table normal_blit_2[] = {
#if SDL_ALTIVEC_BLITTERS
#ifdef SDL_ALTIVEC_BLITTERS
/* has-altivec */
{ 0x0000F800, 0x000007E0, 0x0000001F, 4, 0x00000000, 0x00000000, 0x00000000,
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[] = {
#if SDL_ALTIVEC_BLITTERS
#ifdef SDL_ALTIVEC_BLITTERS
/* has-altivec | dont-use-prefetch */
{ 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 },
@@ -3431,7 +3431,7 @@ SDL_CalculateBlitN(SDL_Surface *surface)
} else if (dstfmt->BytesPerPixel == 1) {
return BlitNto1Key;
} else {
#if SDL_ALTIVEC_BLITTERS
#ifdef SDL_ALTIVEC_BLITTERS
if ((srcfmt->BytesPerPixel == 4) && (dstfmt->BytesPerPixel == 4) && SDL_HasAltiVec()) {
return Blit32to32KeyAltivec;
} else