Skip to content

Commit 3da9257

Browse files
committed
build: fix incomplete strlcpy defines
the current code checks for strlcpy with _GNU_SOURCE defined but never adds it to project arguments. check for it without _GNU_SOURCE first and try again with _GNU_SOURCE after.
1 parent b620982 commit 3da9257

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

meson.build

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,10 @@ elif cc.has_header('linux/close_range.h')
181181
add_project_arguments('-DHAVE_LINUX_CLOSE_RANGE_H', language: 'c')
182182
endif
183183

184-
if cc.has_function('strlcpy', prefix: '#define _GNU_SOURCE\n#include <string.h>')
184+
if cc.has_function('strlcpy', prefix: '#include <string.h>')
185185
add_project_arguments('-DHAVE_STRLCPY', language: 'c')
186+
elif cc.has_function('strlcpy', prefix: '#define _GNU_SOURCE\n#include <string.h>')
187+
add_project_arguments(['-DHAVE_STRLCPY', '-D_GNU_SOURCE'], language: 'c')
186188
endif
187189

188190
if not cc.has_function('pipe2', prefix: '#include <unistd.h>')

0 commit comments

Comments
 (0)