mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-15 01:17:00 +00:00
Visual Studio: calling into _vsnprintf. (#1085)
This commit is contained in:
parent
81562b2b5a
commit
2a67aeaa3d
@ -1257,6 +1257,11 @@ static const char* ImAtoi(const char* src, TYPE* output)
|
|||||||
// Ideally we would test for only one of those limits at runtime depending on the behavior the vsnprintf(), but trying to deduct it at compile time sounds like a pandora can of worm.
|
// Ideally we would test for only one of those limits at runtime depending on the behavior the vsnprintf(), but trying to deduct it at compile time sounds like a pandora can of worm.
|
||||||
// B) When buf==NULL vsnprintf() will return the output size.
|
// B) When buf==NULL vsnprintf() will return the output size.
|
||||||
#ifndef IMGUI_DISABLE_FORMAT_STRING_FUNCTIONS
|
#ifndef IMGUI_DISABLE_FORMAT_STRING_FUNCTIONS
|
||||||
|
|
||||||
|
#if defined(_MSC_VER) && !defined(vsnprintf)
|
||||||
|
#define vsnprintf _vsnprintf
|
||||||
|
#endif
|
||||||
|
|
||||||
int ImFormatString(char* buf, size_t buf_size, const char* fmt, ...)
|
int ImFormatString(char* buf, size_t buf_size, const char* fmt, ...)
|
||||||
{
|
{
|
||||||
IM_ASSERT(fmt != NULL);
|
IM_ASSERT(fmt != NULL);
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#pragma warning (disable: 4996) // 'This function or variable may be unsafe': strcpy, strdup, sprintf, vsnprintf, sscanf, fopen
|
#pragma warning (disable: 4996) // 'This function or variable may be unsafe': strcpy, strdup, sprintf, vsnprintf, sscanf, fopen
|
||||||
#define snprintf _snprintf
|
#define snprintf _snprintf
|
||||||
|
#define vsnprintf _vsnprintf
|
||||||
#endif
|
#endif
|
||||||
#ifdef __clang__
|
#ifdef __clang__
|
||||||
#pragma clang diagnostic ignored "-Wold-style-cast" // warning : use of old-style cast // yes, they are more terse.
|
#pragma clang diagnostic ignored "-Wold-style-cast" // warning : use of old-style cast // yes, they are more terse.
|
||||||
|
Loading…
Reference in New Issue
Block a user