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

fix(tools): fix build on macos #880

Merged
merged 1 commit into from
Feb 11, 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
7 changes: 4 additions & 3 deletions tools/library/tbc/jsonio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "jsonio.h"

#include <limits>
#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || (__cplusplus >= 201703L && !defined(__clang__)))
#include <charconv>
#else
#include <sstream>
Expand Down Expand Up @@ -337,8 +337,9 @@ void JsonReader::readNumber(double &value)
}
}

#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
// Use the faster C++17 method if available.
#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || (__cplusplus >= 201703L && !defined(__clang__)))
// Use the faster C++17 method if available.
// (Skip if clang is detected since it was late to implement, and thus not available on macos yet.)
std::from_chars(buf.data(), buf.data() + buf.size(), value);
#else
std::istringstream(buf) >> value;
Expand Down
Loading