mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-10 08:10:14 +01:00
meson: Test for random_r()
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>
This commit is contained in:
parent
9cc4311d86
commit
c96407f37e
2 changed files with 2 additions and 2 deletions
|
|
@ -1029,7 +1029,7 @@ foreach h : ['xlocale.h', 'sys/sysctl.h', 'linux/futex.h', 'endian.h', 'dlfcn.h'
|
|||
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
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@
|
|||
|
||||
#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()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue