fix meson.build

Co-authored-by: Ariadne Conill <ariadne@dereferenced.org>
pull/249/head
Harmen Stoppels 2023-04-24 15:50:00 +02:00 committed by Ariadne Conill
parent 434cb2935e
commit f7bebba664
2 changed files with 17 additions and 1 deletions

View File

@ -12,6 +12,18 @@
/* Define to 1 if you have the `reallocarray' function. */
#mesondefine HAVE_REALLOCARRAY
/* Define to 1 if you have the `strlcat' function. */
#mesondefine HAVE_DECL_STRLCAT
/* Define to 1 if you have the `strlcpy' function. */
#mesondefine HAVE_DECL_STRLCPY
/* Define to 1 if you have the `strndup' function. */
#mesondefine HAVE_DECL_STRNDUP
/* Define to 1 if you have the `reallocarray' function. */
#mesondefine HAVE_DECL_REALLOCARRAY
/* Name of package */
#mesondefine PACKAGE

View File

@ -30,8 +30,12 @@ check_functions = [
]
foreach f : check_functions
name = f[0].to_upper().underscorify()
if cc.has_function(f[0], prefix : '#define _BSD_SOURCE\n#include <@0@>'.format(f[1])) and cc.has_header_symbol(f[1], f[0], prefix : '#define _BSD_SOURCE')
cdata.set('HAVE_@0@'.format(f[0].to_upper().underscorify()), 1)
cdata.set('HAVE_@0@'.format(name), 1)
cdata.set('HAVE_DECL_@0@'.format(name), 1)
else
cdata.set('HAVE_DECL_@0@'.format(name), 0)
endif
endforeach