From b778fb38a954097c18981fc95ee33902105870bb Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 18 Jul 2018 17:18:34 +0200 Subject: [PATCH] util/StringAPI: add raw strcmp() wrapper --- src/util/StringAPI.hxx | 7 +++++++ src/util/WStringAPI.hxx | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/src/util/StringAPI.hxx b/src/util/StringAPI.hxx index febaabbc7..b8b68938d 100644 --- a/src/util/StringAPI.hxx +++ b/src/util/StringAPI.hxx @@ -127,6 +127,13 @@ UnsafeCopyStringP(char *dest, const char *src) noexcept #endif } +gcc_pure gcc_nonnull_all +static inline int +StringCompare(const char *a, const char *b) noexcept +{ + return strcmp(a, b); +} + /** * Checks whether #a and #b are equal. */ diff --git a/src/util/WStringAPI.hxx b/src/util/WStringAPI.hxx index efe8205ea..13d3fd2cf 100644 --- a/src/util/WStringAPI.hxx +++ b/src/util/WStringAPI.hxx @@ -120,6 +120,13 @@ UnsafeCopyStringP(wchar_t *dest, const wchar_t *src) noexcept #endif } +gcc_pure gcc_nonnull_all +static inline int +StringCompare(const wchar_t *a, const wchar_t *b) noexcept +{ + return wcscmp(a, b); +} + /** * Checks whether str1 and str2 are equal. * @param str1 String 1