From 696335aaf7ca55ee5c9e435c426f622b9e353657 Mon Sep 17 00:00:00 2001 From: Ken Matsui <26405363+ken-matsui@users.noreply.github.com> Date: Wed, 24 Jul 2024 07:04:40 -0700 Subject: [PATCH] Make thread_local for color_mode optional --- include/toml11/fwd/color_fwd.hpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/toml11/fwd/color_fwd.hpp b/include/toml11/fwd/color_fwd.hpp index 284e0e0e..ed711c0d 100644 --- a/include/toml11/fwd/color_fwd.hpp +++ b/include/toml11/fwd/color_fwd.hpp @@ -9,6 +9,12 @@ #define TOML11_ERROR_MESSAGE_COLORIZED false #endif +#ifdef TOML11_USE_THREAD_LOCAL_COLORIZATION +#define TOML11_THREAD_LOCAL_COLORIZATION thread_local +#else +#define TOML11_THREAD_LOCAL_COLORIZATION +#endif + namespace toml { namespace color @@ -44,7 +50,7 @@ class color_mode inline color_mode& color_status() noexcept { - static thread_local color_mode status; + static TOML11_THREAD_LOCAL_COLORIZATION color_mode status; return status; }