Fix Web (and consoles) to run without exceptions throw/catch support
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user