[lsan] Fix win build.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@184555 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/lsan/lsan_common.cc b/lib/lsan/lsan_common.cc
index a86d9ed..341673f 100644
--- a/lib/lsan/lsan_common.cc
+++ b/lib/lsan/lsan_common.cc
@@ -20,14 +20,13 @@
#include "sanitizer_common/sanitizer_stacktrace.h"
#include "sanitizer_common/sanitizer_stoptheworld.h"
-#if CAN_SANITIZE_LEAKS
namespace __lsan {
+#if CAN_SANITIZE_LEAKS
// This mutex is used to prevent races between DoLeakCheck and SuppressObject.
BlockingMutex global_mutex(LINKER_INITIALIZED);
THREADLOCAL int disable_counter;
-bool DisabledInThisThread() { return disable_counter > 0; }
Flags lsan_flags;
@@ -401,10 +400,16 @@
"SUMMARY: LeakSanitizer: %zu byte(s) leaked in %zu allocation(s).\n\n",
bytes, allocations);
}
-
-} // namespace __lsan
#endif // CAN_SANITIZE_LEAKS
+bool DisabledInThisThread() {
+#ifdef CAN_SANITIZE_LEAKS
+ return disable_counter > 0;
+#endif
+ return false;
+}
+} // namespace __lsan
+
using namespace __lsan; // NOLINT
extern "C" {