Skip to content

Commit

Permalink
setlocale is in global namespace on mac os
Browse files Browse the repository at this point in the history
  • Loading branch information
LinuxDevon committed Jan 28, 2024
1 parent 70d1711 commit 38f6284
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ env:

jobs:
linux-builds:
name: ${{matrix.cxx}}, C++${{matrix.std}}, ${{matrix.build_type}}
name: linux ${{matrix.cxx}}, C++${{matrix.std}}, ${{matrix.build_type}}
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -104,9 +104,10 @@ jobs:
shell: cmd

macos-builds:
name: ${{matrix.cxx}}, C++${{matrix.std}}, ${{matrix.build_type}}
name: macos ${{matrix.cxx}}, C++${{matrix.std}}, ${{matrix.build_type}}
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
cxx:
- g++
Expand Down
3 changes: 2 additions & 1 deletion test/locale_testing/test_locale_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ class testRunListener : public Catch::EventListenerBase {
using Catch::EventListenerBase::EventListenerBase;

void testRunStarting(Catch::TestRunInfo const&) override {
prev_loc = std::setlocale(LC_ALL, nullptr);
// Mac OS uses global and c++ standard uses the std. Using this to remove ambiguity between the two.
prev_loc = ::setlocale(LC_ALL, nullptr);
// Set the locale to something that has , instead of . for floats
std::locale::global(std::locale("de_DE.UTF-8"));
}
Expand Down

0 comments on commit 38f6284

Please sign in to comment.