mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-10 22:51:57 +00:00
fix snprintf for msvc8 compiled builds
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2286 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
3a8ae069c4
commit
9338715489
2 changed files with 14 additions and 1 deletions
|
@ -188,7 +188,8 @@ extern "C" {
|
|||
#ifdef _WIN32
|
||||
#if (_MSC_VER >= 1400)
|
||||
//with MSVC 8, use MS extensions
|
||||
#define snprintf sprintf_s
|
||||
#define snprintf linuxlike_snprintf_vc8
|
||||
int VARGS linuxlike_snprintf_vc8(char *buffer, int size, const char *format, ...);
|
||||
#define vsnprintf(a, b, c, d) vsnprintf_s(a, b, _TRUNCATE, c, d)
|
||||
#else
|
||||
//msvc crap
|
||||
|
|
|
@ -3112,6 +3112,18 @@ int VARGS linuxlike_vsnprintf(char *buffer, int size, const char *format, va_lis
|
|||
|
||||
return ret;
|
||||
}
|
||||
#else
|
||||
int VARGS linuxlike_snprintf_vc8(char *buffer, int size, const char *format, ...)
|
||||
{
|
||||
int ret;
|
||||
va_list argptr;
|
||||
|
||||
va_start (argptr, format);
|
||||
ret = vsnprintf_s (buffer,size, _TRUNCATE, format,argptr);
|
||||
va_end (argptr);
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue