From 6c008e990c999dca2f1fff06c5bc96e455f63acd Mon Sep 17 00:00:00 2001 From: Andrew Waterman Date: Wed, 12 Jun 2024 18:06:35 -0700 Subject: Make softfloat's rounding mode thread-local This has no effect on Spike itself, but it might matter for anyone who's using Spike as a library in a multithreaded program. --- softfloat/softfloat.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/softfloat/softfloat.h b/softfloat/softfloat.h index eb78d74..72daccb 100644 --- a/softfloat/softfloat.h +++ b/softfloat/softfloat.h @@ -50,8 +50,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include "softfloat_types.h" -#ifndef THREAD_LOCAL -#define THREAD_LOCAL +#if __has_include() +# include +# define THREAD_LOCAL thread_local +#else +# define THREAD_LOCAL _Thread_local #endif #ifdef __cplusplus -- cgit v1.1