From e8d4de806795a192f3bff03147adfc1e2f53433b Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Mon, 19 Jun 2023 18:22:27 +0300 Subject: [PATCH 19/19] Meson: Make failure to find SIZE_T_PRINTF fatal See osdn #48259 Signed-off-by: Marko Lindqvist --- meson.build | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/meson.build b/meson.build index 1ca7858be4..1126e2d0ec 100644 --- a/meson.build +++ b/meson.build @@ -664,6 +664,7 @@ endif potential_size_t_formats = [ '%zu', '%ld', '%lld', '%I64d', '%I32d' ] +size_t_f = '' foreach format : potential_size_t_formats if c_compiler.compiles('''#include #if defined(__GNUC__) @@ -676,10 +677,15 @@ int main(void) { size_t var = 0; fr("''' + format + '''", var); return 0; }''', include_directories: include_directories(cross_inc_path), args: ['-Werror', '-Wall']) priv_conf_data.set('SIZE_T_PRINTF', '"' + format + '"') + size_t_f = format break endif endforeach +if size_t_f == '' + error('Cannot find correct printf format specifier for size_t') +endif + if c_compiler.compiles('''int main(void) { __builtin_unreachable(); return 0; }''', include_directories: include_directories(cross_inc_path), name: '__builtin_unreachable()', -- 2.39.2