It's better to test for needed functions instead of using external
knowledge about presence in this or that C library.
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
endif
endforeach
-foreach f : ['strtof', 'mkostemp', 'posix_memalign', 'timespec_get', 'memfd_create']
+foreach f : ['strtof', 'mkostemp', 'posix_memalign', 'timespec_get', 'memfd_create', 'random_r']
if cc.has_function(f)
pre_args += '-DHAVE_@0@'.format(f.to_upper())
endif
#define HASH_ALLOC malloc
#define HASH_FREE free
-#ifndef __GLIBC__
+#ifndef HAVE_RANDOM_R
#define HASH_RANDOM_DECL char *ps, rs[256]
#define HASH_RANDOM_INIT(seed) ps = initstate(seed, rs, sizeof(rs))
#define HASH_RANDOM random()