_Analysis_assume_(expression) is removed by precompiler and statements
like: if (test) stdex_assert(expr); resolved to: if (test) ;
Remains to be seen if Xcode is happy with this change.
Signed-off-by: Simon Rozman <simon@rozman.si>
The sgml_unicode.hpp stores UTF-32 strings in
stdex::sgml_unicode_pair::unicode. Hence stdex::utf32_t should be used as
its datatype. Unfortunately, that doesn't work with U string literal: U
requires hundreds of typecasts to make it fit stdex::utf32_t, since char32_t
is signed, stdex::utf32_t is unsigned. OTOH, L string literal cannot be
used on Windows (produces UTF-16, not UTF-32).
Reported-by: Xcode
Signed-off-by: Simon Rozman <simon@rozman.si>
Looks short and compact, but requires static_cast<unsigned int> to cover T1
and T2 of different signess. Which doesn't look all that nice anymore.
However, typecasting would only hide the warning. We want the warning to
occur, to encourage us to sync types on template invocation instead.
Signed-off-by: Simon Rozman <simon@rozman.si>
AOsn is measuring time in **milli**seconds. Not **micro**seconds! All
conversions among clocks were off by a factor of 1000.
Signed-off-by: Simon Rozman <simon@rozman.si>
Unlike Posix, Windows handles HANDLE (file, pipe) and SOCKET descriptors
differently. It uses different close(), different errno... So sys_object
was not usable for socket without templating operations to a traits
class.
Signed-off-by: Simon Rozman <simon@rozman.si>
It's useful to clone std handles when creating streams to write/read to
standard streams. As the stream we give handle to assumes the handle
ownership, it'd close the std handles in stream destructor.
Signed-off-by: Simon Rozman <simon@rozman.si>
MSVC fails to deduce character type from std::string/wstring when
converting to std::basic_string_view.
Reference: f5bce32d06cdcf677ce8080027d3317c6387e715
Signed-off-by: Simon Rozman <simon@rozman.si>
This parameter is needed to provide compatibility between utf16_t and
utf32_t, so we may call this function from a single template for both
types.
Signed-off-by: Simon Rozman <simon@rozman.si>
Windows and Apple (NSString) are using UTF-16 wchar_t. All others use
UTF-32. This eliminates need for additional conversion should we need
UTF-32 on Windows&Apple or UTF-16 on others. Mind, UTF-16↔32 is not a
trivial conversion as it may change number of code units.
Signed-off-by: Simon Rozman <simon@rozman.si>
Since stdex::locale_default is inline, it is initialized by the first
module referencing it. Not necessarily compiled with the same _CONSOLE
definition as other modules. This makes the default locale fluid.
Signed-off-by: Simon Rozman <simon@rozman.si>
Brain-dead _Printf_format_string_ SAL doesn't understand utf32_t is good
enough for unsigned int expected by %x placeholder.
Signed-off-by: Simon Rozman <simon@rozman.si>