From: Tobias Jakobi Date: Tue, 4 Mar 2014 20:55:15 +0000 (+0100) Subject: libretro: only use posix_memalign when it's safe X-Git-Tag: r20~43 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=291224374dd130c5cbee87ccce40a1cd0d9eb968;p=pcsx_rearmed.git libretro: only use posix_memalign when it's safe --- diff --git a/frontend/libretro.c b/frontend/libretro.c index 94d649e0..51c0a6e5 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) {