From: Eli Schwartz Date: Fri, 25 Apr 2025 05:25:40 +0000 (-0400) Subject: meson: simplify and parameterize various standard function checks X-Git-Tag: v2.50.0-rc0~63^2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=61fb2262e71a044198b8b18872a802036c332d80;p=thirdparty%2Fgit.git meson: simplify and parameterize various standard function checks This is repetitive logic. We either want to use some -lc function, or if it is not available we define it as -DNO_XXX and usually (but not always) provide some custom compatibility impl instead. Checking the intent of each block when reading through the file is slow and not very DRY. Switch to taking an array of checkable functions instead. Not all functions are straightforward to move, since different macro prefixes are used. Signed-off-by: Eli Schwartz Signed-off-by: Junio C Hamano --- diff --git a/meson.build b/meson.build index c47cb79af0..ed0359b9c9 100644 --- a/meson.build +++ b/meson.build @@ -1133,11 +1133,6 @@ else build_options_config.set('NO_UNIX_SOCKETS', '1') endif -if not compiler.has_function('pread') - libgit_c_args += '-DNO_PREAD' - libgit_sources += 'compat/pread.c' -endif - if host_machine.system() == 'darwin' libgit_sources += 'compat/precompose_utf8.c' libgit_c_args += '-DPRECOMPOSE_UNICODE' @@ -1290,23 +1285,39 @@ if not compiler.has_member('struct passwd', 'pw_gecos', prefix: '#include