diff options
author | Sven van Haastregt <sven.vanhaastregt@arm.com> | 2018-08-23 09:42:58 +0000 |
---|---|---|
committer | Sven van Haastregt <sven.vanhaastregt@arm.com> | 2018-08-23 09:42:58 +0000 |
commit | 0dfbf6b6085bff1e0d77c16274a0e44fda314047 (patch) | |
tree | 2f089bfa3028a41f8ebe246447378f20b6ee39ac /llvm/lib/Support/LockFileManager.cpp | |
parent | 6bcf2ba2f0fff179602fd60b5e0127cd20fc907e (diff) | |
download | llvm-0dfbf6b6085bff1e0d77c16274a0e44fda314047.zip llvm-0dfbf6b6085bff1e0d77c16274a0e44fda314047.tar.gz llvm-0dfbf6b6085bff1e0d77c16274a0e44fda314047.tar.bz2 |
[Support] Fix some Wundef warnings
For the _WIN32 macro, it is the definedness that matters rather than
the value. Most uses of the macro already rely on the definedness.
This commit fixes the few remaining uses that relied on the value.
Differential Revision: https://reviews.llvm.org/D51105
llvm-svn: 340520
Diffstat (limited to 'llvm/lib/Support/LockFileManager.cpp')
-rw-r--r-- | llvm/lib/Support/LockFileManager.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/Support/LockFileManager.cpp b/llvm/lib/Support/LockFileManager.cpp index 77baf7a..c166230 100644 --- a/llvm/lib/Support/LockFileManager.cpp +++ b/llvm/lib/Support/LockFileManager.cpp @@ -24,7 +24,7 @@ #include <sys/types.h> #include <system_error> #include <tuple> -#if _WIN32 +#ifdef _WIN32 #include <windows.h> #endif #if LLVM_ON_UNIX @@ -295,7 +295,7 @@ LockFileManager::WaitForUnlockResult LockFileManager::waitForUnlock() { if (getState() != LFS_Shared) return Res_Success; -#if _WIN32 +#ifdef _WIN32 unsigned long Interval = 1; #else struct timespec Interval; @@ -310,7 +310,7 @@ LockFileManager::WaitForUnlockResult LockFileManager::waitForUnlock() { // finish up and remove the lock file. // FIXME: Should we hook in to system APIs to get a notification when the // lock file is deleted? -#if _WIN32 +#ifdef _WIN32 Sleep(Interval); #else nanosleep(&Interval, nullptr); @@ -329,7 +329,7 @@ LockFileManager::WaitForUnlockResult LockFileManager::waitForUnlock() { return Res_OwnerDied; // Exponentially increase the time we wait for the lock to be removed. -#if _WIN32 +#ifdef _WIN32 Interval *= 2; #else Interval.tv_sec *= 2; @@ -340,7 +340,7 @@ LockFileManager::WaitForUnlockResult LockFileManager::waitForUnlock() { } #endif } while ( -#if _WIN32 +#ifdef _WIN32 Interval < MaxSeconds * 1000 #else Interval.tv_sec < (time_t)MaxSeconds |