aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/strings.h
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2023-11-29 22:39:54 +0000
committerJosh Rahm <joshuarahm@gmail.com>2023-11-29 22:39:54 +0000
commit21cb7d04c387e4198ca8098a884c78b56ffcf4c2 (patch)
tree84fe5690df1551f0bb2bdfe1a13aacd29ebc1de7 /src/nvim/strings.h
parentd9c904f85a23a496df4eb6be42aa43f007b22d50 (diff)
parent4a8bf24ac690004aedf5540fa440e788459e5e34 (diff)
downloadrneovim-colorcolchar.tar.gz
rneovim-colorcolchar.tar.bz2
rneovim-colorcolchar.zip
Merge remote-tracking branch 'upstream/master' into colorcolcharcolorcolchar
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