Resolve conflicts for functions introduced in Android API level 21.
+ * m4/random.m4 (gl_FUNC_RANDOM): Conditionally set REPLACE_INITSTATE,
+ REPLACE_SETSTATE.
+ * lib/stdlib.in.h (initstate, setstate): Disable _GL_CXXALIASWARN
+ invocation on non-glibc systems.
+
* m4/dprintf.m4 (gl_REPLACE_DPRINTF): Conditionally set REPLACE_DPRINTF.
* lib/stdio.in.h (dprintf): Disable _GL_CXXALIASWARN invocation on
non-glibc systems.
_GL_CXXALIAS_SYS_CAST (initstate, char *,
(unsigned int seed, char *buf, size_t buf_size));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (initstate);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef initstate
# if HAVE_RAW_DECL_INITSTATE
is const char *arg_state. */
_GL_CXXALIAS_SYS_CAST (setstate, char *, (char *arg_state));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (setstate);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef setstate
# if HAVE_RAW_DECL_SETSTATE
-# random.m4 serial 5
+# random.m4 serial 6
dnl Copyright (C) 2012-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
[gl_cv_func_random=yes],
[gl_cv_func_random=no])
])
+ gl_CHECK_FUNCS_ANDROID([initstate], [[#include <stdlib.h>]])
+ gl_CHECK_FUNCS_ANDROID([setstate], [[#include <stdlib.h>]])
if test $gl_cv_func_random = no; then
HAVE_RANDOM=0
HAVE_INITSTATE=0
HAVE_SETSTATE=0
else
- gl_CHECK_FUNCS_ANDROID([initstate], [[#include <stdlib.h>]])
- gl_CHECK_FUNCS_ANDROID([setstate], [[#include <stdlib.h>]])
if test $ac_cv_func_initstate = no; then
HAVE_INITSTATE=0
fi
if test $ac_cv_func_setstate = no; then
HAVE_SETSTATE=0
fi
- if test $ac_cv_func_initstate = no || test $ac_cv_func_setstate = no; then
- dnl In order to define initstate or setstate, we need to define all the
- dnl functions at once.
- REPLACE_RANDOM=1
- if test $ac_cv_func_initstate = yes; then
- REPLACE_INITSTATE=1
- fi
- if test $ac_cv_func_setstate = yes; then
- REPLACE_SETSTATE=1
- fi
+ fi
+ if test $HAVE_INITSTATE = 0; then
+ case "$gl_cv_onwards_func_initstate" in
+ future*) REPLACE_INITSTATE=1 ;;
+ esac
+ fi
+ if test $HAVE_SETSTATE = 0; then
+ case "$gl_cv_onwards_func_setstate" in
+ future*) REPLACE_SETSTATE=1 ;;
+ esac
+ fi
+ if test $ac_cv_func_initstate = no || test $ac_cv_func_setstate = no; then
+ dnl In order to define initstate or setstate, we need to define all the
+ dnl functions at once.
+ REPLACE_RANDOM=1
+ if test $ac_cv_func_initstate = yes; then
+ REPLACE_INITSTATE=1
+ fi
+ if test $ac_cv_func_setstate = yes; then
+ REPLACE_SETSTATE=1
fi
fi