]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: Remove strcasecmp() / strncasecmp() compatibility functions
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Sun, 19 Apr 2020 13:13:02 +0000 (16:13 +0300)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Wed, 23 Mar 2022 10:25:06 +0000 (10:25 +0000)
We don't support any OS where these don't exist.

configure.ac
src/lib/compat.c
src/lib/compat.h

index 31a8199d635143256087fbc20d4fc1cf4edbb492..11c2c567038d70cc3babba53d986efe323296921 100644 (file)
@@ -325,7 +325,7 @@ AC_DEFINE(PACKAGE_WEBPAGE, "http://www.dovecot.org/", [Support URL])
 
 dnl * after -lsocket and -lnsl tests, inet_aton() may be in them
 AC_CHECK_FUNCS(fcntl flock lockf inet_aton sigaction getpagesize madvise \
-               strcasecmp stricmp vsyslog writev pread uname \
+               vsyslog writev pread uname \
               setrlimit setproctitle seteuid setreuid setegid setresgid \
               getmntinfo setpriority quotactl getmntent kqueue kevent \
               backtrace_symbols walkcontext dirfd clearenv \
index 524ef37d8f7cfd8b8b9f17246b1080a1a490a96d..4f7de5e65551c658f8526fdf95fbbb0f58e4f556 100644 (file)
 #  define INADDR_NONE INADDR_BROADCAST
 #endif
 
-#if !defined (HAVE_STRCASECMP) && !defined (HAVE_STRICMP)
-int i_my_strcasecmp(const char *s1, const char *s2)
-{
-       while (*s1 != '\0' && i_toupper(*s1) == i_toupper(*s2)) {
-               s1++; s2++;
-       }
-
-        return i_toupper(*s1) - i_toupper(*s2);
-}
-
-int i_my_strncasecmp(const char *s1, const char *s2, size_t max_chars)
-{
-       while (max_chars > 1 && *s1 != '\0' &&
-              i_toupper(*s1) == i_toupper(*s2)) {
-               s1++; s2++; max_chars--;
-       }
-
-        return i_toupper(*s1) - i_toupper(*s2);
-}
-#endif
-
 #ifndef HAVE_INET_ATON
 int i_my_inet_aton(const char *cp, struct in_addr *inp)
 {
index ce3127ddb434f2c45aed51dcd6c90b7ffdcae618..7cd3c2318957920cceabce298fc5824a14376e05 100644 (file)
@@ -137,19 +137,6 @@ typedef int socklen_t;
        ((st1)->st_ctime == (st2)->st_ctime && \
         ST_NTIMES_EQUAL(ST_CTIME_NSEC(*(st1)), ST_CTIME_NSEC(*(st2))))
 
-/* strcasecmp(), strncasecmp() */
-#ifndef HAVE_STRCASECMP
-#  ifdef HAVE_STRICMP
-#    define strcasecmp stricmp
-#    define strncasecmp strnicmp
-#  else
-#    define strcasecmp i_my_strcasecmp
-#    define strncasecmp i_my_strncasecmp
-int i_my_strcasecmp(const char *s1, const char *s2);
-int i_my_strncasecmp(const char *s1, const char *s2, size_t max_chars);
-#  endif
-#endif
-
 #ifndef HAVE_INET_ATON
 #  include <sys/socket.h>
 #  include <netinet/in.h>