Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion app/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -139,16 +139,30 @@ 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()
conf.set(define, true)
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'))

Expand Down