+2017-08-17 Bruno Haible <bruno@clisp.org>
+
+ random: Fix test compilation failure on Cygwin 1.5.25.
+ * m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Initialize HAVE_DECL_INITSTATE,
+ HAVE_DECL_SETSTATE.
+ * m4/random.m4 (gl_FUNC_RANDOM): Test whether initstate and setstate are
+ declared.
+ * modules/stdlib (Makefile.am): Substitute HAVE_DECL_INITSTATE,
+ HAVE_DECL_SETSTATE.
+ * lib/stdlib.in.h (initstate): Declare also if HAVE_DECL_INITSTATE is 0.
+ (setstate): Declare also if HAVE_DECL_SETSTATE is 0.
+ * doc/posix-functions/initstate.texi: Mention the Cygwin 1.5.x problem.
+ * doc/posix-functions/random.texi: Likewise.
+ * doc/posix-functions/setstate.texi: Likewise.
+ * doc/posix-functions/srandom.texi: Likewise.
+
2017-08-16 Bruno Haible <bruno@clisp.org>
stdnoreturn: Fix test compilation failure on Cygwin.
@item
This function is missing on some platforms:
Solaris 2.4, mingw, MSVC 14.
+@item
+This function is not declared on some platforms:
+Cygwin 1.5.25.
@end itemize
Portability problems not fixed by Gnulib:
Portability problems not fixed by Gnulib:
@itemize
+@item
+This function has a slightly incompatible declaration (the return type being
+@samp{int} instead of @samp{long}) on some platforms:
+Cygwin 1.5.25.
@end itemize
@item
This function is missing on some platforms:
Solaris 2.4, mingw, MSVC 14.
+@item
+This function is not declared on some platforms:
+Cygwin 1.5.25.
@end itemize
Portability problems not fixed by Gnulib:
Portability problems not fixed by Gnulib:
@itemize
+@item
+This function has a slightly incompatible declaration (the return type being
+@samp{long} instead of @samp{void) on some platforms:
+Cygwin 1.5.25.
@end itemize
#endif
#if @GNULIB_RANDOM@
-# if !@HAVE_RANDOM@
+# if !@HAVE_RANDOM@ || !@HAVE_DECL_INITSTATE@
_GL_FUNCDECL_SYS (initstate, char *,
(unsigned int seed, char *buf, size_t buf_size)
_GL_ARG_NONNULL ((2)));
#endif
#if @GNULIB_RANDOM@
-# if !@HAVE_RANDOM@
+# if !@HAVE_RANDOM@ || !@HAVE_DECL_SETSTATE@
_GL_FUNCDECL_SYS (setstate, char *, (char *arg_state) _GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (setstate, char *, (char *arg_state));
-# random.m4 serial 1
+# random.m4 serial 2
dnl Copyright (C) 2012-2017 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
if test $ac_cv_func_random = no; then
HAVE_RANDOM=0
fi
+
+ AC_CHECK_DECLS_ONCE([initstate])
+ if test $ac_cv_have_decl_initstate = no; then
+ HAVE_DECL_INITSTATE=0
+ fi
+
+ AC_CHECK_DECLS_ONCE([setstate])
+ if test $ac_cv_have_decl_setstate = no; then
+ HAVE_DECL_SETSTATE=0
+ fi
])
# Prerequisites of lib/random.c.
-# stdlib_h.m4 serial 43
+# stdlib_h.m4 serial 44
dnl Copyright (C) 2007-2017 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
HAVE_DECL_GETLOADAVG=1; AC_SUBST([HAVE_DECL_GETLOADAVG])
HAVE_GETSUBOPT=1; AC_SUBST([HAVE_GETSUBOPT])
HAVE_GRANTPT=1; AC_SUBST([HAVE_GRANTPT])
+ HAVE_DECL_INITSTATE=1; AC_SUBST([HAVE_DECL_INITSTATE])
HAVE_MKDTEMP=1; AC_SUBST([HAVE_MKDTEMP])
HAVE_MKOSTEMP=1; AC_SUBST([HAVE_MKOSTEMP])
HAVE_MKOSTEMPS=1; AC_SUBST([HAVE_MKOSTEMPS])
HAVE_SECURE_GETENV=1; AC_SUBST([HAVE_SECURE_GETENV])
HAVE_SETENV=1; AC_SUBST([HAVE_SETENV])
HAVE_DECL_SETENV=1; AC_SUBST([HAVE_DECL_SETENV])
+ HAVE_DECL_SETSTATE=1; AC_SUBST([HAVE_DECL_SETSTATE])
HAVE_STRTOD=1; AC_SUBST([HAVE_STRTOD])
HAVE_STRTOLL=1; AC_SUBST([HAVE_STRTOLL])
HAVE_STRTOULL=1; AC_SUBST([HAVE_STRTOULL])
-e 's|@''HAVE_DECL_GETLOADAVG''@|$(HAVE_DECL_GETLOADAVG)|g' \
-e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \
-e 's|@''HAVE_GRANTPT''@|$(HAVE_GRANTPT)|g' \
+ -e 's|@''HAVE_DECL_INITSTATE''@|$(HAVE_DECL_INITSTATE)|g' \
-e 's|@''HAVE_MKDTEMP''@|$(HAVE_MKDTEMP)|g' \
-e 's|@''HAVE_MKOSTEMP''@|$(HAVE_MKOSTEMP)|g' \
-e 's|@''HAVE_MKOSTEMPS''@|$(HAVE_MKOSTEMPS)|g' \
-e 's|@''HAVE_RPMATCH''@|$(HAVE_RPMATCH)|g' \
-e 's|@''HAVE_SECURE_GETENV''@|$(HAVE_SECURE_GETENV)|g' \
-e 's|@''HAVE_DECL_SETENV''@|$(HAVE_DECL_SETENV)|g' \
+ -e 's|@''HAVE_DECL_SETSTATE''@|$(HAVE_DECL_SETSTATE)|g' \
-e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \
-e 's|@''HAVE_STRTOLL''@|$(HAVE_STRTOLL)|g' \
-e 's|@''HAVE_STRTOULL''@|$(HAVE_STRTOULL)|g' \