Remove #unddef __STRICT_ANSI__ in armips, apply fix for non-standard function strcasecmp from armips/946338745955fef3a5528eefeb947751aae9363c

This commit is contained in:
Chase Bradley 2024-12-19 11:57:09 -05:00
parent 9921382a68
commit 48ee471e28

View File

@ -32,7 +32,6 @@ SOFTWARE.
#define _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS
#undef __STRICT_ANSI__
#if defined(__clang__) #if defined(__clang__)
#if __has_feature(cxx_exceptions) #if __has_feature(cxx_exceptions)
@ -15903,16 +15902,19 @@ int runFromCommandLine(const StringList& arguments, ArmipsArguments settings)
#include <vector> #include <vector>
#include <algorithm> #include <algorithm>
#ifndef _WIN32 #include <cctype>
#include <strings.h>
#define _stricmp strcasecmp
#endif
static bool stringEqualInsensitive(const std::string& a, const std::string& b) static bool stringEqualInsensitive(const std::string& a, const std::string& b)
{ {
if (a.size() != b.size()) if (a.size() != b.size())
return false; return false;
return _stricmp(a.c_str(),b.c_str()) == 0;
auto compare = [](char c1, char c2)
{
return std::tolower(c1) == std::tolower(c2);
};
return std::equal(a.begin(), a.end(), b.begin(), compare);
} }
bool compareSection(ElfSection* a, ElfSection* b) bool compareSection(ElfSection* a, ElfSection* b)