From e5b1c2cdeacd665d4ba1632dfba3009796c6ca74 Mon Sep 17 00:00:00 2001 From: nick black Date: Tue, 19 May 2020 08:52:36 -0400 Subject: [PATCH] view/demo/tetris: NCOPTION_INHIBIT_SETLOCALE --- src/demo/demo.c | 1 + src/input/input.cpp | 4 +++- src/tetris/main.h | 1 + src/view/view.cpp | 4 +++- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/demo/demo.c b/src/demo/demo.c index e6ab1678a..6d4d1d4f1 100644 --- a/src/demo/demo.c +++ b/src/demo/demo.c @@ -282,6 +282,7 @@ handle_opts(int argc, char** argv, notcurses_options* opts, bool* ignore_failure usage(*argv, EXIT_FAILURE); } } + opts->flags |= NCOPTION_INHIBIT_SETLOCALE; const char* spec = argv[optind]; return spec; } diff --git a/src/input/input.cpp b/src/input/input.cpp index 06f2ecb17..6c073ad2d 100644 --- a/src/input/input.cpp +++ b/src/input/input.cpp @@ -208,7 +208,9 @@ int main(void){ if(setlocale(LC_ALL, "") == nullptr){ return EXIT_FAILURE; } - NotCurses nc; + notcurses_options nopts{}; + nopts.flags = NCOPTION_INHIBIT_SETLOCALE; + NotCurses nc(nopts); if(!nc.mouse_enable()){ return EXIT_FAILURE; } diff --git a/src/tetris/main.h b/src/tetris/main.h index 536fafaa7..0b7a211ed 100644 --- a/src/tetris/main.h +++ b/src/tetris/main.h @@ -5,6 +5,7 @@ int main(void) { srand(time(nullptr)); std::atomic_bool gameover = false; notcurses_options ncopts{}; + ncopts.flags = NCOPTION_INHIBIT_SETLOCALE; ncpp::NotCurses nc(ncopts); Tetris t{nc, gameover}; std::thread tid(&Tetris::Ticker, &t); diff --git a/src/view/view.cpp b/src/view/view.cpp index 0af9ef838..3a3a0bb79 100644 --- a/src/view/view.cpp +++ b/src/view/view.cpp @@ -191,7 +191,9 @@ auto main(int argc, char** argv) -> int { setlocale(LC_ALL, ""); float timescale; NCScale stretchmode; - auto nonopt = handle_opts(argc, argv, NotCurses::default_notcurses_options, ×cale, &stretchmode); + notcurses_options nopts{}; + auto nonopt = handle_opts(argc, argv, nopts, ×cale, &stretchmode); + nopts.flags |= NCOPTION_INHIBIT_SETLOCALE; NotCurses nc; if(!nc.can_open_images()){ nc.stop();