Fix Web (and consoles) to run without exceptions throw/catch support

This commit is contained in:
Wojtek Figat
2026-02-16 11:50:52 +01:00
parent 7bc687194f
commit 25e90deed6
5 changed files with 53 additions and 7 deletions

View File

@@ -111,6 +111,10 @@
#define _DEPRECATED(_0, _1, LASTARG, ...) LASTARG
#define DEPRECATED(...) _DEPRECATED(, ##__VA_ARGS__, _DEPRECATED_1(__VA_ARGS__), _DEPRECATED_0())
#if defined(__EXCEPTIONS) || defined(__cpp_exceptions) || defined(_CPPUNWIND)
#define HAS_EXCEPTIONS
#endif
// C++ 17
#if __cplusplus >= 201703L
#define IF_CONSTEXPR constexpr

View File

@@ -262,6 +262,7 @@ void LocalizationService::OnLocalizationChanged()
localeName[currentCulture.Length() + 5] = '8';
localeName[currentCulture.Length() + 6] = 0;
}
#if HAS_EXCEPTIONS
try
{
std::locale::global(std::locale(localeName));
@@ -272,6 +273,9 @@ void LocalizationService::OnLocalizationChanged()
catch (...)
{
}
#else
std::locale::global(std::locale(localeName));
#endif
}
#endif