public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin/main] Cygwin: wcichr: add wint_t replacement for wcschr
@ 2023-03-01  9:55 Corinna Vinschen
  0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2023-03-01  9:55 UTC (permalink / raw)
  To: cygwin-cvs

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)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-03-01  9:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-01  9:55 [newlib-cygwin/main] Cygwin: wcichr: add wint_t replacement for wcschr Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).