Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make thread_local for color_mode optional #261

Merged
merged 1 commit into from
Jul 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion include/toml11/fwd/color_fwd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}

Expand Down
Loading