Provide a strndupa implementation when it is absent

strndupa is a glibc exclusive, not even musl implements it
This commit is contained in:
Greg V 2020-11-09 00:40:40 +03:00 committed by Wim Taymans
parent cc0386e1c5
commit 90ade199e6
2 changed files with 20 additions and 0 deletions

View file

@ -267,6 +267,10 @@ if cc.has_type('ptrdiff_t', prefix : '#include <stddef.h>')
cdata.set('HAVE_PTRDIFF_T', 1)
endif
if cc.has_function('strndupa', prefix : '#include <string.h>', args : [ '-D_GNU_SOURCE' ])
cdata.set('HAVE_STRNDUPA', 1)
endif
if cc.has_function('mkstemp', prefix : '#include <stdlib.h>')
cdata.set('HAVE_MKSTEMP', 1)
endif