From 08df6d9c003cf566e316d18f61cd4db1f1b9146e Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Mon, 19 Jun 2023 18:24:50 +0300 Subject: [PATCH 30/30] 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 9944c1c671..05fdf47b11 100644 --- a/meson.build +++ b/meson.build @@ -546,6 +546,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__) @@ -558,10 +559,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 get_option('audio') or get_option('clients').contains('sdl2') if host_system == 'windows' sdl2main_dep = [c_compiler.find_library('mingw32', dirs: cross_lib_path), -- 2.39.2