Skip to content

Commit

Permalink
Apply a test patch to qhexutils.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolajSchlej committed Feb 21, 2025
1 parent 5d94762 commit cccd298
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions UEFITool/QHexView/src/model/qhexutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,21 @@
#include <QtEndian>
#include <limits>

// UEFITool: use tolower from ctype.h instead of std::tolower for Qt 5.6.3 and Windows XP target compatibility
#include <ctype.h>

#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
#define QHEXVIEW_VARIANT_EQ(x, t) ((x).metaType().id() == QMetaType::Q##t)
#else
#define QHEXVIEW_VARIANT_EQ(x, t) ((x).type() == QVariant::t)
#endif

#if defined(_WIN32) && _MSC_VER <= 1916 // v141_xp
#include <ctype.h>
namespace std {
using ::tolower;
}
#else
#include <cctype>
#endif

namespace QHexUtils {

Q_GLOBAL_STATIC_WITH_ARGS(QList<char>, HEXMAP,
Expand Down Expand Up @@ -166,8 +172,8 @@ qint64 findDefault(const QByteArray& value, qint64 startoffset,
uchar ch2 = value.at(i);

if(!(options & QHexFindOptions::CaseSensitive)) {
ch1 = tolower(ch1);
ch2 = tolower(ch2);
ch1 = std::tolower(ch1);
ch2 = std::tolower(ch2);
}

if(ch1 != ch2)
Expand Down

0 comments on commit cccd298

Please sign in to comment.