diff options
| author | 2019-01-27 16:42:12 +0000 | |
|---|---|---|
| committer | 2019-01-27 16:42:12 +0000 | |
| commit | b773203fb58f3ef282fb69c832d8710cab5bc82d (patch) | |
| tree | e75913f147570fbd75169647b144df85b88a038c /gnu/llvm/lib/Support/Mutex.cpp | |
| parent | tweak errno in previous (diff) | |
| download | wireguard-openbsd-b773203fb58f3ef282fb69c832d8710cab5bc82d.tar.xz wireguard-openbsd-b773203fb58f3ef282fb69c832d8710cab5bc82d.zip | |
Import LLVM 7.0.1 release including clang, lld and lldb.
Diffstat (limited to 'gnu/llvm/lib/Support/Mutex.cpp')
| -rw-r--r-- | gnu/llvm/lib/Support/Mutex.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/gnu/llvm/lib/Support/Mutex.cpp b/gnu/llvm/lib/Support/Mutex.cpp index b1d5e7c0d99..7138c7a4b98 100644 --- a/gnu/llvm/lib/Support/Mutex.cpp +++ b/gnu/llvm/lib/Support/Mutex.cpp @@ -12,8 +12,8 @@ //===----------------------------------------------------------------------===// #include "llvm/Support/Mutex.h" -#include "llvm/Support/ErrorHandling.h" #include "llvm/Config/config.h" +#include "llvm/Support/ErrorHandling.h" //===----------------------------------------------------------------------===// //=== WARNING: Implementation here must contain only TRULY operating system @@ -47,10 +47,7 @@ MutexImpl::MutexImpl( bool recursive) { // Declare the pthread_mutex data structures pthread_mutex_t* mutex = - static_cast<pthread_mutex_t*>(malloc(sizeof(pthread_mutex_t))); - - if (mutex == nullptr) - report_bad_alloc_error("Mutex allocation failed"); + static_cast<pthread_mutex_t*>(safe_malloc(sizeof(pthread_mutex_t))); pthread_mutexattr_t attr; @@ -119,9 +116,9 @@ MutexImpl::tryacquire() #elif defined(LLVM_ON_UNIX) #include "Unix/Mutex.inc" -#elif defined( LLVM_ON_WIN32) +#elif defined( _WIN32) #include "Windows/Mutex.inc" #else -#warning Neither LLVM_ON_UNIX nor LLVM_ON_WIN32 was set in Support/Mutex.cpp +#warning Neither LLVM_ON_UNIX nor _WIN32 was set in Support/Mutex.cpp #endif #endif |
