From c95b188fc08387d0a89668e56bce3a4fad1ee611 Mon Sep 17 00:00:00 2001 From: fanquake Date: Fri, 2 Jul 2021 11:10:25 +0800 Subject: [PATCH] system: skip trying to set the locale on NetBSD Just treat it the same as the other BSDs. Fixes #17379. Github-Pull: #22390 Rebased-From: fdd71448e78f442ffd93a3a3398a5062eaba9f1b --- src/util/system.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/system.cpp b/src/util/system.cpp index 258ba2f23550a..65c16fcd97cac 100644 --- a/src/util/system.cpp +++ b/src/util/system.cpp @@ -1301,7 +1301,7 @@ void SetupEnvironment() #endif // On most POSIX systems (e.g. Linux, but not BSD) the environment's locale // may be invalid, in which case the "C.UTF-8" locale is used as fallback. -#if !defined(WIN32) && !defined(MAC_OSX) && !defined(__FreeBSD__) && !defined(__OpenBSD__) +#if !defined(WIN32) && !defined(MAC_OSX) && !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__) try { std::locale(""); // Raises a runtime error if current locale is invalid } catch (const std::runtime_error&) {