From 468840c9ea321cdfc146623a9ef877c39d8000e7 Mon Sep 17 00:00:00 2001 From: dongresource Date: Fri, 11 Sep 2020 00:01:35 +0200 Subject: [PATCH] Fixed gcc vs clang preprocessor tomfoolery. --- src/main.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index f4af7e2..9f1549e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -21,6 +21,13 @@ #include #include +// HACK +#ifdef __has_feature +#if __has_feature(address_sanitizer) +#define __SANITIZE_ADDRESS__ 1 +#endif +#endif + CNShardServer *shardServer; std::thread *shardThread; @@ -34,9 +41,11 @@ void terminate(int arg) { std::cout << "OpenFusion: terminating." << std::endl; shardServer->kill(); shardThread->join(); -#if defined(__SANITIZE_ADDRESS__) || (defined(__has_feature) && __has_feature(address_sanitizer)) + +#if defined(__SANITIZE_ADDRESS__) TableData::cleanup(); #endif + exit(0); }