Skip to content

Commit

Permalink
SporeModLoader: use c++ feature test macro for ends_with()
Browse files Browse the repository at this point in the history
  • Loading branch information
Rosalie241 committed Oct 26, 2024
1 parent 8379072 commit 17f32cf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions SporeModLoader/SporeModLoaderHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,10 @@ std::vector<std::filesystem::path> Path::GetModLibsPaths(void)
std::wstring filename = entry.path().filename().wstring();
for (const auto& postfix : excludePostfixes)
{
// TODO: use ends_with with mingw when we can use C++20
#ifdef _MSC_VER
// we have to support C++17 for MinGW
#ifdef __cpp_lib_starts_ends_with
if (filename.ends_with(postfix))
#else // mingw
#else // C++17
if (filename.find(postfix) != std::wstring::npos)
#endif
{
Expand Down

0 comments on commit 17f32cf

Please sign in to comment.