* src/fips.c: Use __declspec(thread) for MinGW32 thread-local context.

Signed-off-by: Knugi <[email protected]>
---
src/fips.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/src/fips.c b/src/fips.c
index d1aff8a5..d1fa3e03 100644
--- a/src/fips.c
+++ b/src/fips.c
@@ -75,9 +75,15 @@ struct gcry_thread_context {
};

#ifdef HAVE_GCC_STORAGE_CLASS__THREAD
+#ifdef __MINGW32__
+static __declspec(thread) struct gcry_thread_context the_tc = {
+  0, GCRY_FIPS_FLAG_REJECT_DEFAULT
+};
+#else
static __thread struct gcry_thread_context the_tc = {
   0, GCRY_FIPS_FLAG_REJECT_DEFAULT
};
+#endif
#else
#error libgcrypt requires thread-local storage to support FIPS mode
#endif
-- 
2.52.0







Attachment: DCO
Description: Binary data

_______________________________________________
Gcrypt-devel mailing list
[email protected]
https://lists.gnupg.org/mailman/listinfo/gcrypt-devel

Reply via email to