[newlib-cygwin/main] Cygwin: wcichr: add wint_t replacement for wcschr
Corinna Vinschen
corinna@sourceware.org
Wed Mar 1 09:55:31 GMT 2023
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=9870f1d1ffe36f77328c001fdf402c94f56c25ce
commit 9870f1d1ffe36f77328c001fdf402c94f56c25ce
Author: Corinna Vinschen <corinna@vinschen.de>
AuthorDate: Wed Mar 1 10:36:55 2023 +0100
Commit: Corinna Vinschen <corinna@vinschen.de>
CommitDate: Wed Mar 1 10:54:52 2023 +0100
Cygwin: wcichr: add wint_t replacement for wcschr
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diff:
---
winsup/cygwin/local_includes/wchar.h | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/winsup/cygwin/local_includes/wchar.h b/winsup/cygwin/local_includes/wchar.h
index 125e49ece15c..d1b63859177e 100644
--- a/winsup/cygwin/local_includes/wchar.h
+++ b/winsup/cygwin/local_includes/wchar.h
@@ -72,6 +72,19 @@ wcilen (const wint_t *wcs)
return ret;
}
+/* like wcschr, just for wint_t */
+static inline wint_t *
+wcichr (const wint_t *str, wint_t chr)
+{
+ do
+ {
+ if (*str == chr)
+ return (wint_t *) str;
+ }
+ while (*str++);
+ return NULL;
+}
+
/* like wcscmp, just for wint_t */
static inline int
wcicmp (const wint_t *s1, const wint_t *s2)
More information about the Cygwin-cvs
mailing list