From 9901f8ccc248852d4cd7c806358b2c27cdcd62ec Mon Sep 17 00:00:00 2001 From: hyzboy Date: Sat, 21 Aug 2021 17:33:52 +0800 Subject: [PATCH] added vsprintf.cpp of Windows platform. --- src/CMakeLists.txt | 3 ++- src/Win/vsprintf.cpp | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 src/Win/vsprintf.cpp diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8302dd4..b5a30a9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -73,7 +73,8 @@ IF(WIN32) Win/EnumVolume.cpp Win/ProgramPath.cpp) - SET(PLATFORM_CODEPAGE_SOURCE Win/CodePage.cpp) + SET(PLATFORM_CODEPAGE_SOURCE Win/CodePage.cpp + Win/vsprintf.cpp) SET(PLATFORM_SYSTEM_INFO_SOURCE Win/SystemInfo.cpp) diff --git a/src/Win/vsprintf.cpp b/src/Win/vsprintf.cpp new file mode 100644 index 0000000..f61c097 --- /dev/null +++ b/src/Win/vsprintf.cpp @@ -0,0 +1,14 @@ +#include +#include +namespace hgl +{ + template<> int vsprintf(char *buffer,const size_t buf_max,const char *format,va_list va) + { + return vsprintf_s(buffer,buf_max,format,va); + } + + template<> int vsprintf(wchar_t *buffer,const size_t buf_max,const wchar_t *format,va_list va) + { + return vswprintf_s(buffer,buf_max,format,va); + } +}//namespace hgl