From fc6ded175965b4f8a2ffaa74968adca1fd492cba Mon Sep 17 00:00:00 2001 From: Krasimir Angelov Date: Wed, 25 Jan 2023 23:26:09 +0100 Subject: [PATCH] one more fix for thread local on MSVC --- src/runtime/c/pgf/db.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/runtime/c/pgf/db.h b/src/runtime/c/pgf/db.h index c593ea9ba..bb8f373e5 100644 --- a/src/runtime/c/pgf/db.h +++ b/src/runtime/c/pgf/db.h @@ -186,6 +186,10 @@ private: DB_scope* next_scope; }; +#if defined(_MSC_VER) +extern PGF_INTERNAL_DECL __declspec( thread ) DB_scope *last_db_scope; +#else extern PGF_INTERNAL_DECL __thread DB_scope *last_db_scope __attribute__((tls_model("initial-exec"))); +#endif #endif