mirror of
https://github.com/bkaradzic/bx.git
synced 2026-02-18 04:53:06 +01:00
Removed use of wchar_t.
This commit is contained in:
@@ -10,8 +10,7 @@
|
||||
#include <bx/string.h>
|
||||
|
||||
#if !BX_CRT_NONE
|
||||
# include <stdio.h> // vsnprintf, vsnwprintf
|
||||
# include <wchar.h> // vswprintf
|
||||
# include <stdio.h> // vsnprintf
|
||||
#endif // !BX_CRT_NONE
|
||||
|
||||
namespace bx
|
||||
@@ -1113,41 +1112,6 @@ namespace bx
|
||||
return total;
|
||||
}
|
||||
|
||||
int32_t vsnwprintf(wchar_t* _out, int32_t _max, const wchar_t* _format, va_list _argList)
|
||||
{
|
||||
va_list argList;
|
||||
va_copy(argList, _argList);
|
||||
int32_t total = 0;
|
||||
#if BX_CRT_NONE
|
||||
BX_UNUSED(_out, _max, _format, argList);
|
||||
#elif BX_CRT_MSVC
|
||||
int32_t len = -1;
|
||||
if (NULL != _out)
|
||||
{
|
||||
va_list argListCopy;
|
||||
va_copy(argListCopy, _argList);
|
||||
len = ::_vsnwprintf_s(_out, _max, size_t(-1), _format, argListCopy);
|
||||
va_end(argListCopy);
|
||||
}
|
||||
total = -1 == len ? ::_vscwprintf(_format, _argList) : len;
|
||||
#elif BX_CRT_MINGW
|
||||
total = ::vsnwprintf(_out, _max, _format, argList);
|
||||
#else
|
||||
total = ::vswprintf(_out, _max, _format, argList);
|
||||
#endif // BX_COMPILER_MSVC
|
||||
va_end(argList);
|
||||
return total;
|
||||
}
|
||||
|
||||
int32_t swnprintf(wchar_t* _out, int32_t _max, const wchar_t* _format, ...)
|
||||
{
|
||||
va_list argList;
|
||||
va_start(argList, _format);
|
||||
int32_t len = vsnwprintf(_out, _max, _format, argList);
|
||||
va_end(argList);
|
||||
return len;
|
||||
}
|
||||
|
||||
static const char s_units[] = { 'B', 'K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y' };
|
||||
|
||||
template<uint32_t Kilo, char KiloCh0, char KiloCh1>
|
||||
|
||||
Reference in New Issue
Block a user