From 3815d41667f92e20fa8e48e3950d4f42ea217e02 Mon Sep 17 00:00:00 2001 From: zhangbing Date: Tue, 8 Sep 2026 23:06:32 +0800 Subject: [PATCH] Fix MSVC thread-local storage probe --- conf/check_thread_storage.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/conf/check_thread_storage.c b/conf/check_thread_storage.c index e6e1e98..5f1207a 100644 --- a/conf/check_thread_storage.c +++ b/conf/check_thread_storage.c @@ -1,5 +1,9 @@ -extern __thread int x; +#if defined(_MSC_VER) +#define __thread __declspec(thread) +#endif + +__thread int x; int main(int argc, char **argv) { - return 0; + return x; }