summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2023-01-22 12:25:06 +0100
committerBruno Haible <bruno@clisp.org>2023-01-22 15:56:38 +0100
commita26916573e4d78592989c6eecbbe4081d0398d43 (patch)
treed06e9e33e498198624419d95da7bc059ec585278 /m4
parent3dfb81922f3c40795b047c4305cfa28cd60c3269 (diff)
downloadgnulib-a26916573e4d78592989c6eecbbe4081d0398d43.tar.gz
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.
Diffstat (limited to 'm4')
-rw-r--r--m4/random.m436
1 files changed, 23 insertions, 13 deletions
diff --git a/m4/random.m4 b/m4/random.m4
index b99603cf9a..b0d1cb86ee 100644
--- a/m4/random.m4
+++ b/m4/random.m4
@@ -1,4 +1,4 @@
-# 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,
@@ -19,29 +19,39 @@ AC_DEFUN([gl_FUNC_RANDOM],
[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