Initial commit

This commit is contained in:
drof
2026-11-05 02:19:09 +01:00
commit 13f8503697
125 changed files with 17029 additions and 0 deletions
+58
View File
@@ -0,0 +1,58 @@
#pragma once
#pragma warning(push)
#pragma warning(disable : 4244 4066 4309 4305 4244)
namespace stl
{
inline_block char wtoc(wchar_t w)
{
if (w == L'Ё') return 'Ё';
if (w == L'ё') return 'ё';
if (w >= L'А' && w <= L'Я') return w - L'А' + 'А';
if (w >= L'а' && w <= L'я') return w - L'а' + 'а';
return (char)w;
}
inline_block wchar_t ctow(char w)
{
if (w == 'Ё') return L'Ё';
if (w == 'ё') return L'ё';
if (w >= 'А' && w <= 'Я') return w - 'А' + L'А';
if (w >= 'а' && w <= 'я') return w - 'а' + L'а';
return w;
}
inline_block int mbstowcs(wchar_t* Dest, const char* Source, unsigned __int64 Length, unsigned __int64 MaxCount)
{
int result = -1;
if (!Dest)
return 0;
if (Dest && !MaxCount)
return 0;
if (MaxCount > 0x7FFFFFFF)
return -1;
if (!Length)
{
Length = strlen(Source);
if (!Length)
return -1;
}
for (result = 0; (result < Length && result < MaxCount); result++)
{
Dest[result] = ctow(Source[result]);
}
return result;
}
}
#pragma warning(pop)