Skip to content

Commit

Permalink
Only use once_flag/tss_t vars if we have threads.h
Browse files Browse the repository at this point in the history
Partial fix for opencog#1495
  • Loading branch information
ryandesign committed Apr 21, 2024
1 parent 3a26127 commit 94eed5c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions link-grammar/dict-common/regex-morph.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 94eed5c

Please sign in to comment.