Hi Assaf,

> The attached patch works for me on mingw,

Thanks for the investigation.

For me, with a gnulib testdir created through
  ./gnulib-tool --create-testdir --dir=../testdir1 --single-configure random
I still get a link error in test-random. "nm" shows why: random.o defines
__initstate and __setstate, where test-random.c expects initstate and setstate.
But it is easy to fix, now that you have shown how.

I've pushed the combined fix in your name:

2018-12-16  Assaf Gordon  <assafgor...@gmail.com>

        random: Fix build error on native Windows (regression from 2018-06-21).
        * lib/random.c (__srandom, __initstate, __setstate, __random,
        __srandom_r, __initstate_r, __setstate_r, __random_r) [!_LIBC]: Redirect
        to the symbols without '__' prefix.

diff --git a/lib/random.c b/lib/random.c
index d14b820..5e01b72 100644
--- a/lib/random.c
+++ b/lib/random.c
@@ -52,6 +52,14 @@
 #ifndef _LIBC
 # include <libc-config.h>
+# define __srandom srandom
+# define __initstate initstate
+# define __setstate setstate
+# define __random random
+# define __srandom_r srandom_r
+# define __initstate_r initstate_r
+# define __setstate_r setstate_r
+# define __random_r random_r
 /* Specification.  */

Reply via email to