Skip to content

Commit

Permalink
c++23 deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiud committed Oct 5, 2023
1 parent 013b93e commit 9a1a3b1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/logging.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1552,9 +1552,15 @@ static LogMessage::LogMessageData fatal_msg_data_shared;
// allocations).
static thread_local bool thread_data_available = true;

#if defined(__cpp_lib_byte) && __cpp_lib_byte >= 201603L
// std::aligned_storage is deprecated in C++23
static alignas(LogMessage::LogMessageData) std::byte
thread_msg_data[sizeof(LogMessage::LogMessageData)];
#else // !(defined(__cpp_lib_byte) && __cpp_lib_byte >= 201603L)
static thread_local std::aligned_storage<
sizeof(LogMessage::LogMessageData),
alignof(LogMessage::LogMessageData)>::type thread_msg_data;
#endif // defined(__cpp_lib_byte) && __cpp_lib_byte >= 201603L
#endif // defined(GLOG_THREAD_LOCAL_STORAGE)

LogMessage::LogMessageData::LogMessageData()
Expand Down

0 comments on commit 9a1a3b1

Please sign in to comment.