diff options
Diffstat (limited to 'lib/Support/Mutex.cpp')
| -rw-r--r-- | lib/Support/Mutex.cpp | 11 | 
1 files changed, 4 insertions, 7 deletions
| diff --git a/lib/Support/Mutex.cpp b/lib/Support/Mutex.cpp index b1d5e7c0d991..7138c7a4b984 100644 --- a/lib/Support/Mutex.cpp +++ b/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 | 
