From cb66b75692225914bacc1b5f4e32967d37f9cf9d Mon Sep 17 00:00:00 2001
From: Paul Sokolovsky <pfalcon@users.sourceforge.net>
Date: Tue, 11 Sep 2018 00:40:41 +0300
Subject: [PATCH] tests/unix/ffi_float: Skip if strtof() is not available.

As the case for e.g. Android's Bionic Libc.
---
 tests/unix/ffi_float.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/tests/unix/ffi_float.py b/tests/unix/ffi_float.py
index c92a39bcd..317436855 100644
--- a/tests/unix/ffi_float.py
+++ b/tests/unix/ffi_float.py
@@ -18,7 +18,14 @@ def ffi_open(names):
 
 libc = ffi_open(('libc.so', 'libc.so.0', 'libc.so.6', 'libc.dylib'))
 
-strtof = libc.func("f", "strtof", "sp")
+try:
+    strtof = libc.func("f", "strtof", "sp")
+except OSError:
+    # Some libc's (e.g. Android's Bionic) define strtof as macro/inline func
+    # in terms of strtod().
+    print("SKIP")
+    raise SystemExit
+
 print('%.6f' % strtof('1.23', None))
 
 strtod = libc.func("d", "strtod", "sp")
-- 
GitLab