[newlib-cygwin/cygwin-3_6-branch] Cygwin: Update search.h functions for POSIX.1-2024

Takashi Yano via Cygwin-cvs <[email protected]>
Newsgroups gmane.os.cygwin.cvs
Message-ID <[email protected]>
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=4504d610671d3b7872d63ff5447dddf153d926ed

commit 4504d610671d3b7872d63ff5447dddf153d926ed
Author: Mark Geisert <[email protected]>
Date:   Thu May 1 21:56:48 2025 -0700

    Cygwin: Update search.h functions for POSIX.1-2024
    
    Add type posix_tnode.  Change certain uses of "void" to "posix_tnode" in
    both the prototypes and definitions of functions associated with <search.h>.
    
    (Necessary changes to Newlib's /libc/include/search.h have already been
    submitted in a patch sent to newlib-9JcytcrH/[email protected])
    
    Reported-by: Collin Funk <[email protected]>
    Addresses: https://cygwin.com/pipermail/cygwin/2025-April/258032.html
    Signed-off-by: Mark Geisert <[email protected]>
    Fixes: ec98d19a08c2 "* wininfo.h (wininfo::timer_active): Delete."
    (cherry picked from commit e6b915d86ae328550a05f777ca62c3a6a490afaf)

Diff:
---
 winsup/cygwin/include/search.h | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/winsup/cygwin/include/search.h b/winsup/cygwin/include/search.h
index f532eae55..7c6d7b4cf 100644
--- a/winsup/cygwin/include/search.h
+++ b/winsup/cygwin/include/search.h
@@ -39,6 +39,8 @@ typedef	struct node
 } node_t;
 #endif
 
+typedef void posix_tnode;
+
 struct hsearch_data
 {
   struct internal_head *htable;
@@ -58,13 +60,13 @@ ENTRY *hsearch (ENTRY, ACTION);
 int hcreate_r (size_t, struct hsearch_data *);
 void hdestroy_r (struct hsearch_data *);
 int hsearch_r (ENTRY, ACTION, ENTRY **, struct hsearch_data *);
-void *tdelete (const void * __restrict, void ** __restrict,
+void *tdelete (const void * __restrict, posix_tnode ** __restrict,
 	       int (*) (const void *, const void *));
 void tdestroy (void *, void (*)(void *));
-void *tfind (const void *, void **,
+posix_tnode *tfind (const void *, posix_tnode *const *,
 	     int (*) (const void *, const void *));
-void *tsearch (const void *, void **, int (*) (const void *, const void *));
-void  twalk (const void *, void (*) (const void *, VISIT, int));
+posix_tnode *tsearch (const void *, posix_tnode **, int (*) (const void *, const void *));
+void  twalk (const posix_tnode *, void (*) (const posix_tnode *, VISIT, int));
 void *lfind (const void *, const void *, size_t *, size_t,
 	     int (*) (const void *, const void *));
 void *lsearch (const void *, void *, size_t *, size_t,
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.