aboutsummaryrefslogtreecommitdiffstats
path: root/gowin/main.cc
diff options
context:
space:
mode:
authorYRabbit <rabbit@yrabbit.cyou>2022-03-15 21:52:32 +1000
committerYRabbit <rabbit@yrabbit.cyou>2022-03-15 21:52:32 +1000
commitad00f3fdeb9e48a63c2781815d265266123f2621 (patch)
tree9ee7a649b54d3217eb772c86ba0bb48978a7dddf /gowin/main.cc
parent25d7e3ae8b409a1be550e25a2dbabc3c54f0d446 (diff)
downloadnextpnr-ad00f3fdeb9e48a63c2781815d265266123f2621.tar.gz
nextpnr-ad00f3fdeb9e48a63c2781815d265266123f2621.tar.bz2
nextpnr-ad00f3fdeb9e48a63c2781815d265266123f2621.zip
gowin: test locale workaround
Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
Diffstat (limited to 'gowin/main.cc')
-rw-r--r--gowin/main.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/gowin/main.cc b/gowin/main.cc
index db74545e..e3c6762b 100644
--- a/gowin/main.cc
+++ b/gowin/main.cc
@@ -95,7 +95,11 @@ int main(int argc, char *argv[])
// floating point strings whose representation depends on the locale. If
// you don't do this, the strings will be in the C locale and later when Qt
// starts it won't be able to read them back as numbers.
- std::locale::global(std::locale(""));
+ try {
+ std::locale::global(std::locale(""));
+ } catch (const std::runtime_error &e) {
+ // the locale is broken in this system, so leave it as it is
+ }
GowinCommandHandler handler(argc, argv);
return handler.exec();
}