Codechange: replace strncasecmp with case ignoring variant of StrStarts/EndsWith

This commit is contained in:
Rubidium
2023-04-27 13:21:08 +02:00
committed by rubidium42
parent 86786a7af6
commit 4dd5f994be
10 changed files with 410 additions and 41 deletions

View File

@@ -37,10 +37,6 @@
# define _GNU_SOURCE
#endif
#if defined(__HAIKU__) || defined(__CYGWIN__)
# include <strings.h> /* strncasecmp */
#endif
/* It seems that we need to include stdint.h before anything else
* We need INT64_MAX, which for most systems comes from stdint.h. However, MSVC
* does not have stdint.h.
@@ -71,11 +67,6 @@
# include <sys/types.h>
#endif
#if defined(__OS2__)
# include <types.h>
# define strcasecmp stricmp
#endif
/* Stuff for GCC */
#if defined(__GNUC__) || (defined(__clang__) && !defined(_MSC_VER))
# define NORETURN __attribute__ ((noreturn))
@@ -207,9 +198,6 @@
# endif
# endif
# define strcasecmp stricmp
# define strncasecmp strnicmp
/* MSVC doesn't have these :( */
# define S_ISDIR(mode) (mode & S_IFDIR)
# define S_ISREG(mode) (mode & S_IFREG)
@@ -411,11 +399,6 @@ void NORETURN AssertFailedError(int line, const char *file, const char *expressi
# define assert(expression) if (unlikely(!(expression))) AssertFailedError(__LINE__, __FILE__, #expression);
#endif
#if defined(OPENBSD)
/* OpenBSD uses strcasecmp(3) */
# define _stricmp strcasecmp
#endif
#if defined(MAX_PATH)
/* It's already defined, no need to override */
#elif defined(PATH_MAX) && PATH_MAX > 0