Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions .github/workflows/ZenLib_Checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,23 +60,18 @@ jobs:
CMake:
strategy:
matrix:
include:
- runner: windows-latest
CXXFLAGS: "/WX"
- runner: ubuntu-latest
CXXFLAGS: "-Werror"
- runner: macos-latest
CXXFLAGS: "-Werror"
runner: [windows-latest, windows-11-arm, ubuntu-latest, macos-latest]
unicode_setting: [default, utf-8]
fail-fast: false
name: CMake (${{ matrix.runner }})
name: CMake (${{ matrix.runner }}${{ matrix.unicode_setting == 'utf-8' && ', utf-8' || '' }})
runs-on: ${{ matrix.runner }}
env:
CXXFLAGS: ${{ matrix.CXXFLAGS }}
CXXFLAGS: ${{ contains(matrix.runner, 'windows') && '/WX' || '-Werror' }}
steps:
- name: Checkout ZenLib
uses: actions/checkout@v6
- name: Configure CMake project
run: cmake -S Project/CMake -B build -DCMAKE_BUILD_TYPE=Release
run: cmake -S Project/CMake -B build -DCMAKE_BUILD_TYPE=Release ${{ matrix.unicode_setting == 'utf-8' && '-DENABLE_UNICODE=OFF' || '' }}
- name: Build CMake project
run: cmake --build build ${{ runner.os == 'Windows' && '--config Release' || '-j4' }}

Expand Down
12 changes: 10 additions & 2 deletions Source/ZenLib/Ztring.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2374,15 +2374,23 @@ bool Ztring::IsNumber() const
//Mise en minuscules
Ztring &Ztring::MakeLowerCase()
{
transform(begin(), end(), begin(), (int(*)(int))tolower); //(int(*)(int)) is a patch for unix
#if defined(__UNICODE__)
transform(begin(), end(), begin(), [](wchar_t c) { return towlower(c); });
#else // defined(__UNICODE__)
transform(begin(), end(), begin(), [](unsigned char c) { return tolower(c); });
#endif // defined(__UNICODE__)
return *this;
}

//---------------------------------------------------------------------------
// Mise en majuscules
Ztring &Ztring::MakeUpperCase()
{
transform(begin(), end(), begin(), (int(*)(int))toupper); //(int(*)(int)) is a patch for unix
#if defined(__UNICODE__)
transform(begin(), end(), begin(), [](wchar_t c) { return towupper(c); });
#else // defined(__UNICODE__)
transform(begin(), end(), begin(), [](unsigned char c) { return toupper(c); });
#endif // defined(__UNICODE__)
return *this;
}

Expand Down
Loading