Fix to support pre-C++17
Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
parent
13703b1747
commit
51d7ee3493
@ -162,6 +162,12 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if _HAS_CXX17
|
||||
#define _Constexpr_ constexpr
|
||||
#else
|
||||
#define _Constexpr_
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#define _Deprecated_(message) __declspec(deprecated(message))
|
||||
#else
|
||||
|
@ -101,7 +101,7 @@ namespace stdex
|
||||
return;
|
||||
}
|
||||
|
||||
if constexpr (sizeof(T_from) == sizeof(char) && sizeof(T_to) == sizeof(wchar_t)) {
|
||||
if _Constexpr_ (sizeof(T_from) == sizeof(char) && sizeof(T_to) == sizeof(wchar_t)) {
|
||||
assert(count_src < INT_MAX || count_src == SIZE_MAX);
|
||||
|
||||
// Try to convert to stack buffer first.
|
||||
@ -124,7 +124,7 @@ namespace stdex
|
||||
throw std::runtime_error("MultiByteToWideChar failed");
|
||||
}
|
||||
|
||||
if constexpr (sizeof(T_from) == sizeof(wchar_t) && sizeof(T_to) == sizeof(char)) {
|
||||
if _Constexpr_ (sizeof(T_from) == sizeof(wchar_t) && sizeof(T_to) == sizeof(char)) {
|
||||
assert(count_src < INT_MAX || count_src == SIZE_MAX);
|
||||
|
||||
// Try to convert to stack buffer first.
|
||||
@ -147,7 +147,7 @@ namespace stdex
|
||||
throw std::runtime_error("WideCharToMultiByte failed");
|
||||
}
|
||||
|
||||
if constexpr (sizeof(T_from) == sizeof(char) && sizeof(T_to) == sizeof(char)) {
|
||||
if _Constexpr_ (sizeof(T_from) == sizeof(char) && sizeof(T_to) == sizeof(char)) {
|
||||
assert(count_src < INT_MAX || count_src == SIZE_MAX);
|
||||
|
||||
// Try to convert to stack buffer first.
|
||||
|
Loading…
x
Reference in New Issue
Block a user