From 8fe261d8b4c26c0cb9f863ec3850c4b82755a42f Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Sat, 5 Aug 2017 10:08:11 -0400 Subject: [PATCH] QUtil::strcasecmp --- include/qpdf/QUtil.hh | 3 +++ libqpdf/QUtil.cc | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/include/qpdf/QUtil.hh b/include/qpdf/QUtil.hh index 87904ea1..ed396c07 100644 --- a/include/qpdf/QUtil.hh +++ b/include/qpdf/QUtil.hh @@ -166,6 +166,9 @@ namespace QUtil QPDF_DLL std::list read_lines_from_file(std::istream&); + QPDF_DLL + int strcasecmp(char const *, char const *); + // These routines help the tokenizer recognize certain character // classes without using ctype, which we avoid because of locale // considerations. diff --git a/libqpdf/QUtil.cc b/libqpdf/QUtil.cc index ffe69148..29217cc6 100644 --- a/libqpdf/QUtil.cc +++ b/libqpdf/QUtil.cc @@ -619,3 +619,13 @@ QUtil::read_lines_from_file(std::istream& in) return result; } + +int +QUtil::strcasecmp(char const *s1, char const *s2) +{ +#ifdef _WIN32 + return _stricmp(s1, s2); +#else + return ::strcasecmp(s1, s2); +#endif +}