[ox/std] Change __has_include_nexts to __has_include

This commit is contained in:
Gary Talent 2022-12-18 21:11:41 -06:00
parent 706f5b345a
commit b818c1e3d6

View File

@ -9,7 +9,7 @@
#if defined(OX_USE_STDLIB) && __has_include(<unistd.h>) #if defined(OX_USE_STDLIB) && __has_include(<unistd.h>)
#include <iostream> #include <iostream>
#if __has_include_next(<execinfo.h>) #if __has_include(<execinfo.h>)
#include <execinfo.h> #include <execinfo.h>
#include <dlfcn.h> #include <dlfcn.h>
#endif #endif
@ -32,7 +32,7 @@ static auto symbolicate([[maybe_unused]]char **frames,
[[maybe_unused]]const char *linePrefix) { [[maybe_unused]]const char *linePrefix) {
using StrT = BasicString<100>; using StrT = BasicString<100>;
Vector<StrT, 30> out; Vector<StrT, 30> out;
#if __has_include(<cxxabi.h>) && __has_include_next(<execinfo.h>) #if __has_include(<cxxabi.h>) && __has_include(<execinfo.h>)
for (auto i = 0u; i < symbolsLen; ++i) { for (auto i = 0u; i < symbolsLen; ++i) {
Dl_info info; Dl_info info;
if (dladdr(frames[i], &info) && info.dli_sname) { if (dladdr(frames[i], &info) && info.dli_sname) {
@ -51,7 +51,7 @@ static auto symbolicate([[maybe_unused]]char **frames,
#endif // defined(OX_USE_STDLIB) && __has_include(<unistd.h>) #endif // defined(OX_USE_STDLIB) && __has_include(<unistd.h>)
void printStackTrace([[maybe_unused]]unsigned shave) noexcept { void printStackTrace([[maybe_unused]]unsigned shave) noexcept {
#if defined(OX_USE_STDLIB) && __has_include(<unistd.h>) && __has_include_next(<execinfo.h>) #if defined(OX_USE_STDLIB) && __has_include(<unistd.h>) && __has_include(<execinfo.h>)
constexpr auto FrameCnt = 100; constexpr auto FrameCnt = 100;
Vector<void*, FrameCnt> frames(FrameCnt); Vector<void*, FrameCnt> frames(FrameCnt);
frames.resize(static_cast<std::size_t>(backtrace(frames.data(), static_cast<int>(frames.size())))); frames.resize(static_cast<std::size_t>(backtrace(frames.data(), static_cast<int>(frames.size()))));