Skip to content

Commit aef0d21

Browse files
committed
Runtime: Fix unused declaration warnings in Backtrace.cpp.
1 parent 43fcb2c commit aef0d21

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

stdlib/public/runtime/Backtrace.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ bool isPrivileged() {
309309
}
310310
#endif
311311

312+
#if SWIFT_BACKTRACE_ON_CRASH_SUPPORTED
312313
#if _WIN32
313314
bool writeProtectMemory(void *ptr, size_t size) {
314315
return !!VirtualProtect(ptr, size, PAGE_READONLY, NULL);
@@ -318,6 +319,7 @@ bool writeProtectMemory(void *ptr, size_t size) {
318319
return mprotect(ptr, size, PROT_READ) == 0;
319320
}
320321
#endif
322+
#endif
321323

322324
} // namespace
323325

@@ -1061,6 +1063,7 @@ _swift_backtrace_demangle(const char *mangledName,
10611063
return nullptr;
10621064
}
10631065

1066+
#if SWIFT_BACKTRACE_ON_CRASH_SUPPORTED
10641067
namespace {
10651068

10661069
char addr_buf[18];
@@ -1117,6 +1120,7 @@ trueOrFalse(OnOffTty oot) {
11171120
}
11181121

11191122
} // namespace
1123+
#endif
11201124

11211125
// N.B. THIS FUNCTION MUST BE SAFE TO USE FROM A CRASH HANDLER. On Linux
11221126
// and macOS, that means it must be async-signal-safe. On Windows, there

0 commit comments

Comments
 (0)