diff --git a/onnxruntime/core/platform/posix/stacktrace.cc b/onnxruntime/core/platform/posix/stacktrace.cc index 76864b2..185f131 100644 --- a/onnxruntime/core/platform/posix/stacktrace.cc +++ b/onnxruntime/core/platform/posix/stacktrace.cc @@ -3,7 +3,7 @@ #include "core/common/common.h" -#if !defined(__ANDROID__) && !defined(__wasm__) && !defined(_OPSCHEMA_LIB_) && !defined(_AIX) +#if defined(__GLIBC__) && !defined(__ANDROID__) && !defined(__wasm__) && !defined(_OPSCHEMA_LIB_) && !defined(_AIX) #include #endif #include @@ -13,7 +13,7 @@ namespace onnxruntime { std::vector GetStackTrace() { std::vector stack; -#if !defined(NDEBUG) && !defined(__ANDROID__) && !defined(__wasm__) && !defined(_OPSCHEMA_LIB_) +#if defined(__GLIBC__) && !defined(NDEBUG) && !defined(__ANDROID__) && !defined(__wasm__) && !defined(_OPSCHEMA_LIB_) constexpr int kCallstackLimit = 64; // Maximum depth of callstack void* array[kCallstackLimit];