Add NO_POSIX_MEMALIGN option in Makefile.libretro to support platform
that don't provide the posix_memalign() function.
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
endif
endif
CFLAGS += -DHAVE_MMAP=$(if $(NO_MMAP),0,1) \
- -DHAVE_PTHREAD=$(if $(NO_PTHREAD),0,1)
+ -DHAVE_PTHREAD=$(if $(NO_PTHREAD),0,1) \
+ -DHAVE_POSIX_MEMALIGN=$(if $(NO_POSIX_MEMALIGN),0,1)
CXXFLAGS += $(CFLAGS)
#DRC_DBG = 1
#PCNT = 1
CFLAGS += -DARM -D__aarch64__=1 -march=armv8-a -mtune=cortex-a57 -mtp=soft -DHAVE_INTTYPES -DLSB_FIRST -ffast-math -mcpu=cortex-a57+crc+fp+simd -ffunction-sections
CFLAGS += -ftree-vectorize
CFLAGS += -Ifrontend/switch -ftree-vectorize
+ NO_POSIX_MEMALIGN := 1
NO_PTHREAD=1
LIBPTHREAD :=
STATIC_LINKING=1
ARCH = arm
STATIC_LINKING = 1
NO_PTHREAD=1
+ NO_POSIX_MEMALIGN := 1
# CTR(3DS)
else ifeq ($(platform), ctr)
ARCH = arm
HAVE_NEON = 0
STATIC_LINKING = 1
+ NO_POSIX_MEMALIGN := 1
# Xbox 360
else ifeq ($(platform), xenon)
#ifdef _3DS
vout_buf = linearMemAlign(VOUT_MAX_WIDTH * VOUT_MAX_HEIGHT * 2, 0x80);
-#elif defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200112L) && !defined(VITA) && !defined(__SWITCH__)
+#elif defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200112L) && HAVE_POSIX_MEMALIGN
if (posix_memalign(&vout_buf, 16, VOUT_MAX_WIDTH * VOUT_MAX_HEIGHT * 2) != 0)
vout_buf = (void *) 0;
#else