Skip to content

Commit

Permalink
support C++23
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiud committed Oct 5, 2023
1 parent 3411d58 commit 7d31693
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: true
matrix:
std: [14, 17, 20]
std: [14, 17, 20, 23]
abi: [arm64-v8a, armeabi-v7a, x86_64, x86]
build_type: [Debug, Release]

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/emscripten.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
matrix:
build_type: [Release, Debug]
lib: [static]
std: [14, 17, 20]
std: [14, 17, 20, 23]

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
matrix:
build_type: [Release, Debug]
lib: [shared, static]
std: [14, 17, 20]
std: [14, 17, 20, 23]

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
fail-fast: true
matrix:
std: [14, 17, 20]
std: [14, 17, 20, 23]
include:
- generator: Ninja
- build_type: Debug
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
build_type: [Debug, Release]
lib: [shared, static]
msvc: [VS-16-2019, VS-17-2022]
std: [14, 17, 20]
std: [14, 17, 20, 23]
include:
- msvc: VS-16-2019
os: windows-2019
Expand Down Expand Up @@ -138,7 +138,7 @@ jobs:
matrix:
build_type: [Debug]
lib: [shared, static]
std: [14, 17, 20]
std: [14, 17, 20, 23]
sys: [mingw32, mingw64]
include:
- sys: mingw32
Expand Down
8 changes: 8 additions & 0 deletions src/logging.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@

#include <algorithm>
#include <cassert>
#include <cstddef>
#include <iomanip>
#include <string>

#ifdef HAVE_UNISTD_H
# include <unistd.h> // For _exit.
#endif
Expand Down Expand Up @@ -1552,9 +1554,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
alignas(LogMessage::LogMessageData) static 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 7d31693

Please sign in to comment.