https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=ad29c33229e5fdd9a93469933d4ab77a733877af

commit ad29c33229e5fdd9a93469933d4ab77a733877af
Author:     Corinna Vinschen <[email protected]>
AuthorDate: Thu Mar 13 18:17:22 2025 +0100
Commit:     Corinna Vinschen <[email protected]>
CommitDate: Thu Mar 13 18:17:59 2025 +0100

    Cygwin: stdlib.h: revert declaring arc4random_stir() as function
    
    The idea to define arc4random_stir() as macro to avoid autoconf
    problems in commit a8891c932192 ("Cygwin: stdlib.h: resurrect
    arc4random_stir() definition") worked fine for OpenSSH, but not
    for libbsd.  During the build process the macro shadows the
    definition of arc4random_stir() and results in an error message
    like this:
    
      error: macro "arc4random_stir" passed 1 arguments, but takes just 0
    
    Give up and just declare arc4random_stir() in a compatible way with
    libbsd again.
    
    Fixes: a8891c932192 ("Cygwin: stdlib.h: resurrect arc4random_stir() 
definition")
    Signed-off-by: Corinna Vinschen <[email protected]>

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

diff --git a/winsup/cygwin/include/cygwin/stdlib.h 
b/winsup/cygwin/include/cygwin/stdlib.h
index 6191e549021f..8391960a9abf 100644
--- a/winsup/cygwin/include/cygwin/stdlib.h
+++ b/winsup/cygwin/include/cygwin/stdlib.h
@@ -21,9 +21,9 @@ const char *getprogname (void);
 void   setprogname (const char *);
 
 #if __BSD_VISIBLE
-/* Cygwin exports arc4random_stir() for backward compatibility.  Define
-   here as empty macro to avoid compiler warnings. */
-#define arc4random_stir()
+/* Cygwin exports arc4random_stir() for backward compatibility.
+   Keep the declaration compatible with libbsd. */
+void arc4random_stir(void);
 #endif
 #if __GNU_VISIBLE
 char *canonicalize_file_name (const char *);

Reply via email to