Fix: check for rand_r() in compat-rand.h
authorMichael Jeanson <mjeanson@efficios.com>
Thu, 23 Jun 2016 18:32:23 +0000 (14:32 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 27 Jun 2016 20:48:41 +0000 (16:48 -0400)
The rand_r() function exists in newer Android versions,
detect it instead of relying on the __ANDROID__ define.

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
configure.ac
src/compat-rand.h

index 6a481e3..cd5a05a 100644 (file)
@@ -94,6 +94,7 @@ AC_CHECK_FUNCS([ \
        memeset \
        memset \
        munmap \
+       rand_r \
        sched_getcpu \
        strerror \
        strtoul \
index 7c6acde..835d99b 100644 (file)
@@ -28,7 +28,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#ifdef __ANDROID__
+#ifndef HAVE_RAND_R
 /*
  * Reentrant random function from POSIX.1c.
  * Copyright (C) 1996, 1999 Free Software Foundation, Inc.
@@ -58,6 +58,6 @@ static inline int rand_r(unsigned int *seed)
 
        return result;
 }
-#endif /* __ANDROID__ */
+#endif /* HAVE_RAND_R */
 
 #endif /* _COMPAT_RAND_H */
This page took 0.051363 seconds and 4 git commands to generate.