[ox/std] Fix __has_include logic
This commit is contained in:
parent
8c576ef9c5
commit
9187bcf62b
4
deps/ox/src/ox/std/stacktrace.cpp
vendored
4
deps/ox/src/ox/std/stacktrace.cpp
vendored
@ -6,7 +6,7 @@
|
|||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(OX_USE_STDLIB)
|
#if defined(OX_USE_STDLIB) && __has_include(<unistd.h>)
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <execinfo.h>
|
#include <execinfo.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@ -18,7 +18,7 @@
|
|||||||
namespace ox {
|
namespace ox {
|
||||||
|
|
||||||
void printStackTrace([[maybe_unused]]int shave) {
|
void printStackTrace([[maybe_unused]]int shave) {
|
||||||
#if defined(OX_USE_STDLIB)
|
#if defined(OX_USE_STDLIB) && __has_include(<unistd.h>)
|
||||||
std::array<void*, 100> frames;
|
std::array<void*, 100> frames;
|
||||||
auto size = static_cast<int>(backtrace(frames.data(), frames.size()));
|
auto size = static_cast<int>(backtrace(frames.data(), frames.size()));
|
||||||
if (size > shave) {
|
if (size > shave) {
|
||||||
|
2
deps/ox/src/ox/std/trace.cpp
vendored
2
deps/ox/src/ox/std/trace.cpp
vendored
@ -15,8 +15,6 @@
|
|||||||
|
|
||||||
#include "trace.hpp"
|
#include "trace.hpp"
|
||||||
|
|
||||||
int counter = 0;
|
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
void oxTraceHook([[maybe_unused]] const char *file, [[maybe_unused]] int line,
|
void oxTraceHook([[maybe_unused]] const char *file, [[maybe_unused]] int line,
|
||||||
[[maybe_unused]] const char *ch, [[maybe_unused]] const char *msg) {
|
[[maybe_unused]] const char *ch, [[maybe_unused]] const char *msg) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user