From 48ee471e28d197c834b306000a21278b5f61d6a9 Mon Sep 17 00:00:00 2001 From: Chase Bradley Date: Thu, 19 Dec 2024 11:57:09 -0500 Subject: [PATCH] Remove #unddef __STRICT_ANSI__ in armips, apply fix for non-standard function strcasecmp from armips/946338745955fef3a5528eefeb947751aae9363c --- tools/armips.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tools/armips.cpp b/tools/armips.cpp index 271bf558..bc63ebc4 100644 --- a/tools/armips.cpp +++ b/tools/armips.cpp @@ -32,7 +32,6 @@ SOFTWARE. #define _CRT_SECURE_NO_WARNINGS -#undef __STRICT_ANSI__ #if defined(__clang__) #if __has_feature(cxx_exceptions) @@ -15903,16 +15902,19 @@ int runFromCommandLine(const StringList& arguments, ArmipsArguments settings) #include #include -#ifndef _WIN32 -#include -#define _stricmp strcasecmp -#endif +#include static bool stringEqualInsensitive(const std::string& a, const std::string& b) { if (a.size() != b.size()) 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)