mirror of
https://github.com/Genymobile/scrcpy.git
synced 2026-04-21 01:33:36 +00:00
Check headers for reallocarray
This commit is contained in:
parent
3281fda6ef
commit
a1c620d50e
1 changed files with 15 additions and 1 deletions
|
|
@ -139,9 +139,14 @@ check_functions = [
|
|||
'vasprintf',
|
||||
'nrand48',
|
||||
'jrand48',
|
||||
'reallocarray',
|
||||
]
|
||||
|
||||
check_functions_in_headers = {
|
||||
'stdlib.h': [
|
||||
'reallocarray'
|
||||
],
|
||||
}
|
||||
|
||||
foreach f : check_functions
|
||||
if cc.has_function(f)
|
||||
define = 'HAVE_' + f.underscorify().to_upper()
|
||||
|
|
@ -149,6 +154,15 @@ foreach f : check_functions
|
|||
endif
|
||||
endforeach
|
||||
|
||||
foreach header, f_list : check_functions_in_headers
|
||||
foreach f : f_list
|
||||
if cc.has_function(f) and cc.has_header_symbol(header, f, args: ['-D_GNU_SOURCE'])
|
||||
define = 'HAVE_' + f.underscorify().to_upper()
|
||||
conf.set(define, true)
|
||||
endif
|
||||
endforeach
|
||||
endforeach
|
||||
|
||||
conf.set('HAVE_SOCK_CLOEXEC', host_machine.system() != 'windows' and
|
||||
cc.has_header_symbol('sys/socket.h', 'SOCK_CLOEXEC'))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue