From 94eed5c8be51e390bb8feb61112d46cc2c83ac64 Mon Sep 17 00:00:00 2001 From: Ryan Carsten Schmidt Date: Sun, 21 Apr 2024 17:31:09 -0500 Subject: [PATCH] Only use once_flag/tss_t vars if we have threads.h Partial fix for #1495 --- link-grammar/dict-common/regex-morph.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/link-grammar/dict-common/regex-morph.c b/link-grammar/dict-common/regex-morph.c index cc342e756..2743e0b02 100644 --- a/link-grammar/dict-common/regex-morph.c +++ b/link-grammar/dict-common/regex-morph.c @@ -166,8 +166,11 @@ static void reg_free(Regex_node *rn) /* ========================================================================= */ #if HAVE_PCRE2_H +#if HAVE_THREADS_H && !__EMSCRIPTEN__ static once_flag call_once_flag = ONCE_FLAG_INIT; static tss_t re_md_key; +#endif // HAVE_THREADS_H && !__EMSCRIPTEN__ + static void alloc_key(void) { int rc = tss_create(&re_md_key, (tss_dtor_t) pcre2_match_data_free);