Skip to content

Commit 7839740

Browse files
committed
Fix compile error
1 parent 34e1592 commit 7839740

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

sanitizers/sanitizers.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,16 @@
2121

2222
std::atomic<char*> globalSanitizerLogPath{nullptr};
2323

24-
void initSanitizerPath(const char* path) {
25-
if (auto* const newPath = strdup(path)) {
26-
if (auto* const oldPath = globalSanitizerLogPath.exchange(newPath)) {
27-
free(oldPath);
24+
extern "C" {
25+
26+
void initSanitizerPath(const char* path) {
27+
if (auto* const newPath = strdup(path)) {
28+
if (auto* const oldPath = globalSanitizerLogPath.exchange(newPath)) {
29+
free(oldPath);
30+
}
2831
}
2932
}
30-
}
3133

32-
extern "C" {
3334
__attribute__((used, visibility("default")))
3435
// NOLINTNEXTLINE(bugprone-reserved-identifier)
3536
const char* __asan_default_options() { return "detect_leaks=1"; }

0 commit comments

Comments
 (0)