mirror of
https://github.com/libretro/RetroArch
synced 2025-02-28 22:13:51 +00:00
Fixup compat_snprintf.c for MSVC 2008
This commit is contained in:
parent
6266065384
commit
c12baad087
@ -23,10 +23,7 @@
|
|||||||
/* THIS FILE HAS NOT BEEN VALIDATED ON PLATFORMS BESIDES MSVC */
|
/* THIS FILE HAS NOT BEEN VALIDATED ON PLATFORMS BESIDES MSVC */
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
|
|
||||||
#include <retro_common.h>
|
#include <stdio.h>
|
||||||
#if _MSC_VER >= 1800
|
|
||||||
#include <stdio.h> /* added for _vsnprintf_s and _vscprintf on VS2015 and VS2017 */
|
|
||||||
#endif
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
#if _MSC_VER < 1800
|
#if _MSC_VER < 1800
|
||||||
@ -54,11 +51,14 @@ int c99_vsnprintf_retro__(char *outBuf, size_t size, const char *format, va_list
|
|||||||
int count = -1;
|
int count = -1;
|
||||||
|
|
||||||
if (size != 0)
|
if (size != 0)
|
||||||
|
{
|
||||||
#if (_MSC_VER <= 1310)
|
#if (_MSC_VER <= 1310)
|
||||||
count = _vsnprintf(outBuf, size - 1, format, ap);
|
count = _vsnprintf(outBuf, size - 1, format, ap);
|
||||||
#else
|
#else
|
||||||
count = _vsnprintf_s(outBuf, size, size - 1, format, ap);
|
count = _vsnprintf_s(outBuf, size, size - 1, format, ap);
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
if (count == -1)
|
if (count == -1)
|
||||||
count = _vscprintf(format, ap);
|
count = _vscprintf(format, ap);
|
||||||
|
|
||||||
|
@ -39,8 +39,8 @@ extern "C" {
|
|||||||
int c99_snprintf_retro__(char *outBuf, size_t size, const char *format, ...);
|
int c99_snprintf_retro__(char *outBuf, size_t size, const char *format, ...);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Pre-MSVC 2010 compilers don't implement vsnprintf in a cross-platform manner? Not sure about this one. */
|
/* Pre-MSVC 2008 compilers don't implement vsnprintf in a cross-platform manner? Not sure about this one. */
|
||||||
#if _MSC_VER < 1600
|
#if _MSC_VER < 1500
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#ifndef vsnprintf
|
#ifndef vsnprintf
|
||||||
|
Loading…
x
Reference in New Issue
Block a user