From bbcc2ed8f09cbc438740a0a87034f5854895e7fb Mon Sep 17 00:00:00 2001 From: Netanel Haber <58652339+netanel-haber@users.noreply.github.com> Date: Tue, 10 Feb 2026 22:34:24 +0200 Subject: [PATCH] Update snakepath.h --- snakepath.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/snakepath.h b/snakepath.h index 853b17c..eb1f6ce 100644 --- a/snakepath.h +++ b/snakepath.h @@ -2674,14 +2674,16 @@ bool sp_walk(const SpPath *p, bool top_down, bool follow_symlinks, /* ============ Fluent API Implementation ============ */ #ifdef SNAKEPATH_FLUENT -#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L && !defined(__STDC_NO_THREADS__) -#define SP_TLS _Thread_local -#elif defined(__GNUC__) || defined(__clang__) -#define SP_TLS __thread +#if defined(__cplusplus) && __cplusplus >= 201103L + #define SP_TLS thread_local +#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L && !defined(__STDC_NO_THREADS__) + #define SP_TLS _Thread_local #elif defined(_MSC_VER) -#define SP_TLS __declspec(thread) + #define SP_TLS __declspec(thread) +#elif defined(__GNUC__) || defined(__clang__) + #define SP_TLS __thread #else -#define SP_TLS /* fallback: not thread-safe */ + #error "No thread-local storage support" #endif static SP_TLS SpPath sp_priv_f_ctx;