meson: simplify __thread check and fix MinGW

> was missing.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev
2025-11-23 14:50:55 -08:00
parent af2671a212
commit a0c6bb32dd

View File

@@ -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')