[PATCH] w32: Use __declspec(thread) for FIPS thread context TLS
Knugi via Gcrypt-devel <[email protected]> Mon, 8 Dec 2025 17:17:42 +0100 (CET)
| Newsgroups | gmane.comp.encryption.gpg.libgcrypt.devel |
|---|---|
| Message-ID | <[email protected]> |
* 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 _______________________________________________ Gcrypt-devel mailing list [email protected] https://lists.gnupg.org/mailman/listinfo/gcrypt-devel
DCO
(application/octet-stream, 1.2 KB) - not displayed