Skip to content
Snippets Groups Projects
Commit f66178e4 authored by deuce's avatar deuce
Browse files

Use __MSVCRT__ to detect if the vsnprintf() implementation is by Microsoft(R)

parent 04a99315
Branches
Tags
No related merge requests found
......@@ -854,7 +854,7 @@ CIOLIBEXPORT int CIOLIBCALL ciolib_cprintf(const char *fmat, ...)
{
va_list argptr;
int ret;
#ifdef _MSC_VER /* Can't figure out a way to allocate a "big enough" buffer for Win32. */
#if defined(_MSC_VER) || define(__MSVCRT__) /* Can't figure out a way to allocate a "big enough" buffer for Win32. */
char str[16384];
#else
char *str;
......@@ -877,7 +877,7 @@ CIOLIBEXPORT int CIOLIBCALL ciolib_cprintf(const char *fmat, ...)
va_end(argptr);
#else
#ifdef _MSC_VER
#if defined(_MSC_VER) || define(__MSVCRT__)
ret=_vsnprintf(str,sizeof(str)-1,fmat,argptr);
#else
......@@ -895,7 +895,7 @@ CIOLIBEXPORT int CIOLIBCALL ciolib_cprintf(const char *fmat, ...)
ret=vsprintf(str,fmat,argptr2);
#endif
va_end(argptr);
#ifndef _MSC_VER
#if defined(_MSC_VER) || define(__MSVCRT__)
va_end(argptr2);
#endif
if(ret>=0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment