From: Bruno Haible <bruno@clisp.org>
Date: Thu, 20 Apr 2023 00:03:43 +0000 (+0200)
Subject: random: Fix compilation errors in C++ mode on mingw 10.
X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=ad1ad25c2c90148259e186c3030a5fb31b48bccc;p=gnulib.git

random: Fix compilation errors in C++ mode on mingw 10.

* lib/stdlib.in.h (random, srandom): Disable _GL_CXXALIASWARN invocation
on non-glibc systems.
---

diff --git a/ChangeLog b/ChangeLog
index 8bbfb0978d..87dd03628f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2023-04-19  Bruno Haible  <bruno@clisp.org>
+
+	random: Fix compilation errors in C++ mode on mingw 10.
+	* lib/stdlib.in.h (random, srandom): Disable _GL_CXXALIASWARN invocation
+	on non-glibc systems.
+
 2023-04-18  Bruno Haible  <bruno@clisp.org>
 
 	ilogbl: Work around a Cygwin 3.4.6 bug.
diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h
index 2291a7bbfb..2ae216de62 100644
--- a/lib/stdlib.in.h
+++ b/lib/stdlib.in.h
@@ -898,7 +898,9 @@ _GL_FUNCDECL_SYS (random, long, (void));
                                int.  */
 _GL_CXXALIAS_SYS_CAST (random, long, (void));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (random);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef random
 # if HAVE_RAW_DECL_RANDOM
@@ -923,7 +925,9 @@ _GL_FUNCDECL_SYS (srandom, void, (unsigned int seed));
                                        unsigned long seed.  */
 _GL_CXXALIAS_SYS_CAST (srandom, void, (unsigned int seed));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (srandom);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef srandom
 # if HAVE_RAW_DECL_SRANDOM