commit: 72c07a61de54ce0226855f1f60f1099e8365f1db
parent: a41ee4b7fd945bc52c8a3835f1c06b86f738c0de
author: Brian Callahan <bcallah@openbsd.org>
date: Sat, 13 Mar 2021 01:59:44 -0500
configure: Intentionally fail reallocarray check on Android.
We learned that at least on Termux, there are situations where the
headers and libc don't agree on the existance of reallocarray.
The portable version we carry in the repo is straight out of
OpenBSD, so it is fine to unconditionally use it on Android.
Fix #53
1 file changed, 7 insertions(+)
diff --git a/configure b/configure
@@ -435,9 +435,16 @@ EOF
fi
}
+# Intentionally fail on Android.
+# Avoids header/library mismatches as found on
+# (at least) Termux. Doesn't hurt to use the
+# portable reallocarray in this repo.
reallocarraycheck() {
cat << EOF > conftest.c
#include <stdlib.h>
+#ifdef __ANDROID__
+00ThisWillDefinitelyFail00
+#endif
int main(void){reallocarray(NULL, 0, 0);return 0;}
EOF
$cc $cflags -o conftest.o -c conftest.c > /dev/null 2>&1