From 63d480d0376b617a2775cc5a2fc323b68207748b Mon Sep 17 00:00:00 2001 From: Tobias Jakobi Date: Tue, 4 Mar 2014 21:55:15 +0100 Subject: [PATCH] libretro: only use posix_memalign when it's safe --- frontend/libretro.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/libretro.c b/frontend/libretro.c index 13a4af38..b8dc36dd 100644 --- a/frontend/libretro.c +++ b/frontend/libretro.c @@ -989,7 +989,11 @@ void retro_init(void) exit(1); } +#if defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200112L) posix_memalign(&vout_buf, 16, VOUT_MAX_WIDTH * VOUT_MAX_HEIGHT * 2); +#else + vout_buf = malloc(VOUT_MAX_WIDTH * VOUT_MAX_HEIGHT * 2); +#endif if (environ_cb(RETRO_ENVIRONMENT_GET_SYSTEM_DIRECTORY, &dir) && dir) { -- 2.39.5