Commit c60b2192 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

stdio.h: Add ucrt version of vsnprintf inline wrapper.

parent 229c3379
...@@ -22,10 +22,6 @@ ...@@ -22,10 +22,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(vcruntime); WINE_DEFAULT_DEBUG_CHANNEL(vcruntime);
#define UCRTBASE_PRINTF_STANDARD_SNPRINTF_BEHAVIOUR (0x0002)
int __cdecl __stdio_common_vsprintf(unsigned __int64 options, char *str, size_t len, const char *format,
_locale_t locale, __ms_va_list valist);
int* CDECL __processing_throw(void); int* CDECL __processing_throw(void);
/********************************************************************* /*********************************************************************
...@@ -58,9 +54,3 @@ int __cdecl __uncaught_exceptions(void) ...@@ -58,9 +54,3 @@ int __cdecl __uncaught_exceptions(void)
{ {
return *__processing_throw(); return *__processing_throw();
} }
int __cdecl _vsnprintf( char *buf, size_t size, const char *fmt, __ms_va_list args )
{
return __stdio_common_vsprintf( UCRTBASE_PRINTF_STANDARD_SNPRINTF_BEHAVIOUR,
buf, size, fmt, NULL, args );
}
...@@ -95,7 +95,6 @@ char* __cdecl _tempnam(const char*,const char*); ...@@ -95,7 +95,6 @@ char* __cdecl _tempnam(const char*,const char*);
int __cdecl _unlink(const char*); int __cdecl _unlink(const char*);
int WINAPIV _scprintf(const char*,...); int WINAPIV _scprintf(const char*,...);
int __cdecl _vscprintf(const char*,__ms_va_list); int __cdecl _vscprintf(const char*,__ms_va_list);
int __cdecl _vsnprintf(char*,size_t,const char*,__ms_va_list);
int __cdecl _vsnprintf_s(char*,size_t,size_t,const char*,__ms_va_list); int __cdecl _vsnprintf_s(char*,size_t,size_t,const char*,__ms_va_list);
int __cdecl _vsprintf_p_l(char*,size_t,const char*,_locale_t,__ms_va_list); int __cdecl _vsprintf_p_l(char*,size_t,const char*,_locale_t,__ms_va_list);
...@@ -173,6 +172,31 @@ int __cdecl vsprintf_s(char*,size_t,const char*,__ms_va_list); ...@@ -173,6 +172,31 @@ int __cdecl vsprintf_s(char*,size_t,const char*,__ms_va_list);
unsigned int __cdecl _get_output_format(void); unsigned int __cdecl _get_output_format(void);
unsigned int __cdecl _set_output_format(void); unsigned int __cdecl _set_output_format(void);
#ifdef _UCRT
_ACRTIMP int __cdecl __stdio_common_vsprintf(unsigned __int64,char*,size_t,const char*,_locale_t,__ms_va_list);
static inline int __cdecl vsnprintf(char *buffer, size_t size, const char *format, __ms_va_list args)
{
int ret = __stdio_common_vsprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR,
buffer, size, format, NULL, args);
return ret < 0 ? -1 : ret;
}
static inline int __cdecl _vsnprintf(char *buffer, size_t size, const char *format, __ms_va_list args)
{
int ret = __stdio_common_vsprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION,
buffer, size, format, NULL, args);
return ret < 0 ? -1 : ret;
}
#else /* _UCRT */
int __cdecl _vsnprintf(char*,size_t,const char*,__ms_va_list);
static inline int vsnprintf(char *buffer, size_t size, const char *format, __ms_va_list args) { return _vsnprintf(buffer,size,format,args); }
#endif /* _UCRT */
#endif /* _STDIO_DEFINED */ #endif /* _STDIO_DEFINED */
#ifdef __cplusplus #ifdef __cplusplus
...@@ -191,7 +215,6 @@ static inline char* tempnam(const char *dir, const char *prefix) { return _tempn ...@@ -191,7 +215,6 @@ static inline char* tempnam(const char *dir, const char *prefix) { return _tempn
static inline int unlink(const char* path) { return _unlink(path); } static inline int unlink(const char* path) { return _unlink(path); }
#define _UNLINK_DEFINED #define _UNLINK_DEFINED
#endif #endif
static inline int vsnprintf(char *buffer, size_t size, const char *format, __ms_va_list args) { return _vsnprintf(buffer,size,format,args); }
static inline int WINAPIV snprintf(char *buffer, size_t size, const char *format, ...) static inline int WINAPIV snprintf(char *buffer, size_t size, const char *format, ...)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment