[ox/std] Fix __has_include logic

This commit is contained in:
Gary Talent 2019-12-19 23:42:43 -06:00
parent 8c576ef9c5
commit 9187bcf62b
2 changed files with 2 additions and 4 deletions

View File

@ -6,7 +6,7 @@
* 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 <execinfo.h>
#include <iostream>
@ -18,7 +18,7 @@
namespace ox {
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;
auto size = static_cast<int>(backtrace(frames.data(), frames.size()));
if (size > shave) {

View File

@ -15,8 +15,6 @@
#include "trace.hpp"
int counter = 0;
extern "C"
void oxTraceHook([[maybe_unused]] const char *file, [[maybe_unused]] int line,
[[maybe_unused]] const char *ch, [[maybe_unused]] const char *msg) {