From 84a46280f68b3732828d778b2307e6bbb769e90a Mon Sep 17 00:00:00 2001 From: Boris Faure Date: Tue, 1 Sep 2020 19:00:30 +0200 Subject: [PATCH] private.h: add static_strequal() --- src/bin/private.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/bin/private.h b/src/bin/private.h index b91d8e21..c201f239 100644 --- a/src/bin/private.h +++ b/src/bin/private.h @@ -58,6 +58,9 @@ extern int _log_domain; #define startswith(str, constref) \ (!strncmp(str, constref, sizeof(constref) - 1)) +#define static_strequal(STR, STATIC_STR) \ + (!strncmp(STR, STATIC_STR, strlen(STATIC_STR))) + #if !defined(HAVE_STRCHRNUL) static inline char * strchrnul(const char *s, int c)