Fix compilation error with -DLIBCXXABI_ENABLE_THREADS=OFF
authorMichael Platings <michael.platings@arm.com>
Thu, 25 Apr 2019 09:27:50 +0000 (09:27 +0000)
committerMichael Platings <michael.platings@arm.com>
Thu, 25 Apr 2019 09:27:50 +0000 (09:27 +0000)
The error is:

libcxxabi/src/cxa_guard_impl.h: In instantiation of ‘__cxxabiv1::{anonymous}::LibcppMutex __cxxabiv1::{anonymous}::GlobalStatic<__cxxabiv1::{anonymous}::LibcppMutex>::instance’:
libcxxabi/src/cxa_guard_impl.h:529:62:   required from here
libcxxabi/src/cxa_guard_impl.h:510:23: error: ‘__cxxabiv1::{anonymous}::LibcppMutex __cxxabiv1::{anonymous}::GlobalStatic<__cxxabiv1::{anonymous}::LibcppMutex>::instance’ has incomplete type
 _LIBCPP_SAFE_STATIC T GlobalStatic<T>::instance = {};
                       ^

llvm-svn: 359175

libcxxabi/src/cxa_guard_impl.h

index ea82d20..412099e 100644 (file)
@@ -257,6 +257,9 @@ struct LibcppCondVar {
 private:
   std::__libcpp_condvar_t cond = _LIBCPP_CONDVAR_INITIALIZER;
 };
+#else
+struct LibcppMutex {};
+struct LibcppCondVar {};
 #endif // !defined(_LIBCXXABI_HAS_NO_THREADS)