aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/strings.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/strings.h')
-rw-r--r--src/nvim/strings.h34
1 files changed, 27 insertions, 7 deletions
diff --git a/src/nvim/strings.h b/src/nvim/strings.h
index 6ad9daf5bf..d717362f87 100644
--- a/src/nvim/strings.h
+++ b/src/nvim/strings.h
@@ -1,13 +1,14 @@
-#ifndef NVIM_STRINGS_H
-#define NVIM_STRINGS_H
+#pragma once
-#include <stdarg.h>
-#include <stdbool.h>
+#include <stdarg.h> // IWYU pragma: keep
#include <string.h>
+#include "auto/config.h"
#include "klib/kvec.h"
-#include "nvim/eval/typval.h"
-#include "nvim/types.h"
+#include "nvim/eval/typval_defs.h" // IWYU pragma: keep
+#include "nvim/func_attr.h"
+#include "nvim/os/os_defs.h"
+#include "nvim/types_defs.h" // IWYU pragma: keep
/// Append string to string and return pointer to the next byte
///
@@ -31,4 +32,23 @@ typedef kvec_t(char) StringBuilder;
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "strings.h.generated.h"
#endif
-#endif // NVIM_STRINGS_H
+
+#ifdef HAVE_STRCASECMP
+# define STRICMP(d, s) strcasecmp((char *)(d), (char *)(s))
+#else
+# ifdef HAVE_STRICMP
+# define STRICMP(d, s) stricmp((char *)(d), (char *)(s))
+# else
+# define STRICMP(d, s) vim_stricmp((char *)(d), (char *)(s))
+# endif
+#endif
+
+#ifdef HAVE_STRNCASECMP
+# define STRNICMP(d, s, n) strncasecmp((char *)(d), (char *)(s), (size_t)(n))
+#else
+# ifdef HAVE_STRNICMP
+# define STRNICMP(d, s, n) strnicmp((char *)(d), (char *)(s), (size_t)(n))
+# else
+# define STRNICMP(d, s, n) vim_strnicmp((char *)(d), (char *)(s), (size_t)(n))
+# endif
+#endif