util: add reallocarray wrapper for win32

Acked-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17746>
This commit is contained in:
Dave Airlie
2022-07-28 07:00:07 +10:00
committed by Marge Bot
parent c83bbbd860
commit 419b52f1de
2 changed files with 63 additions and 0 deletions

View File

@@ -1089,6 +1089,10 @@ if cc.compiles('__uint128_t foo(void) { return 0; }',
pre_args += '-DHAVE_UINT128'
endif
if cc.has_function('reallocarray')
pre_args += '-DHAVE_REALLOCARRAY'
endif
# TODO: this is very incomplete
if ['linux', 'cygwin', 'gnu', 'freebsd', 'gnu/kfreebsd', 'haiku', 'android'].contains(host_machine.system())
pre_args += '-D_GNU_SOURCE'