Skip to content

Commit 71b6e8e

Browse files
authored
[wpiutil] Avoid including execinfo.h for Emscripten target (#7854)
1 parent 1a835fe commit 71b6e8e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: wpiutil/src/main/native/unix/StackTrace.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44

55
#include "wpi/StackTrace.h"
66

7+
#ifndef __EMSCRIPTEN__
78
#include <execinfo.h>
9+
#endif
810

911
#include <string>
1012

@@ -16,7 +18,7 @@
1618
namespace wpi {
1719

1820
std::string GetStackTraceDefault(int offset) {
19-
#ifndef __ANDROID__
21+
#if !defined(__ANDROID__) && !defined(__EMSCRIPTEN__)
2022
void* stackTrace[128];
2123
int stackSize = backtrace(stackTrace, 128);
2224
char** mangledSymbols = backtrace_symbols(stackTrace, stackSize);
@@ -40,7 +42,7 @@ std::string GetStackTraceDefault(int offset) {
4042

4143
return std::string{trace.str()};
4244
#else
43-
// backtrace_symbols not supported on android
45+
// backtrace_symbols not supported
4446
return "";
4547
#endif
4648
}

0 commit comments

Comments
 (0)