From 0b2d35f63fb0e6dd4f541e40430dbf762a2466ed Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Mon, 28 Oct 2019 12:46:45 +0100 Subject: [PATCH] Fix snprintf and vsnprintf definition inconsistencies. --- imgui_demo.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/imgui_demo.cpp b/imgui_demo.cpp index c9ee0f433..3eedda458 100644 --- a/imgui_demo.cpp +++ b/imgui_demo.cpp @@ -100,12 +100,17 @@ Index of this file: // Play it nice with Windows users. Notepad in 2017 still doesn't display text data with Unix-style \n. #ifdef _WIN32 #define IM_NEWLINE "\r\n" -#define snprintf _snprintf -#define vsnprintf _vsnprintf #else #define IM_NEWLINE "\n" #endif +#if defined(_MSC_VER) && !defined(snprintf) +#define snprintf _snprintf +#endif +#if defined(_MSC_VER) && !defined(vsnprintf) +#define vsnprintf _vsnprintf +#endif + //----------------------------------------------------------------------------- // [SECTION] Forward Declarations, Helpers //-----------------------------------------------------------------------------