From: Rosen Penev Date: Sun, 23 Nov 2025 22:50:55 +0000 (-0800) Subject: meson: simplify __thread check and fix MinGW X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a0c6bb32ddd4a8bd6d8435ff88dbc957516bfa4e;p=thirdparty%2Fjson-c.git meson: simplify __thread check and fix MinGW > was missing. Signed-off-by: Rosen Penev --- diff --git a/meson.build b/meson.build index d5a92a7..5b153e8 100644 --- a/meson.build +++ b/meson.build @@ -124,16 +124,12 @@ foreach d, h : decls endif endforeach -check_thread = cc.compiles(''' - __thread int x = 0; - int main() { return x; } - ''', - name: 'Check for __thread support') +check_thread = cc.compiles('__thread int x;', name: 'Check for __thread support') if check_thread conf_data.set('HAVE___THREAD', 1) conf_data.set('SPEC___THREAD', '__thread') -elif cc.get_id().contains('msvc') +elif cc.get_argument_syntax() == 'msvc' conf_data.set('SPEC___THREAD', '__declspec(thread)') endif @@ -212,7 +208,6 @@ json_header = configure_file( configuration: jhconf_data ) - # Platform-specific flags add_project_arguments('-D_GNU_SOURCE', language: 'c')