From fc64f6d82a26d3e861859744722b851dd23820c4 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 14 Sep 2015 21:47:41 -0400 Subject: [PATCH] msvc: Conditionally enable the snprintf macro VS2015 implements the normal form of snprintf, so the define will cause compile errors. --- libretro-common/include/compat/msvc.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libretro-common/include/compat/msvc.h b/libretro-common/include/compat/msvc.h index 6a76876662..c0c2364aa1 100644 --- a/libretro-common/include/compat/msvc.h +++ b/libretro-common/include/compat/msvc.h @@ -23,14 +23,15 @@ #ifndef __LIBRETRO_SDK_COMPAT_MSVC_H #define __LIBRETRO_SDK_COMPAT_MSVC_H -#ifdef _WIN32 +#ifdef _MSC_VER + +// Pre-MSVC 2015 compilers don't implement snprintf in a cross-platform manner. +#if _MSC_VER < 1900 #ifndef snprintf #define snprintf _snprintf #endif #endif -#ifdef _MSC_VER - #undef UNICODE /* Do not bother with UNICODE at this time. */ #include #include