msvc: Conditionally enable the snprintf macro

VS2015 implements the normal form of snprintf, so the define will cause compile errors.
This commit is contained in:
Lioncash 2015-09-14 21:47:41 -04:00
parent da907ab54f
commit fc64f6d82a
1 changed files with 4 additions and 3 deletions

View File

@ -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 <direct.h>
#include <stddef.h>