From 87ae1f009ce03d18e459ad8d66050da9a9f63144 Mon Sep 17 00:00:00 2001 From: Bernard Normier Date: Thu, 9 Aug 2012 15:40:44 -0400 Subject: Added native cond-var implementation on Windows (bug #2667) for Visual Studio 2012 and up Removed all #define and checks for _WIN32_WINNT (no longer needed) Misc build fixes for Visual Studio IceUtil/Config.h cleanup (minor) --- cpp/src/IceUtil/FileUtil.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) mode change 100644 => 100755 cpp/src/IceUtil/FileUtil.cpp (limited to 'cpp/src/IceUtil/FileUtil.cpp') diff --git a/cpp/src/IceUtil/FileUtil.cpp b/cpp/src/IceUtil/FileUtil.cpp old mode 100644 new mode 100755 index 58e321c5d63..9fe0a5f85d3 --- a/cpp/src/IceUtil/FileUtil.cpp +++ b/cpp/src/IceUtil/FileUtil.cpp @@ -208,7 +208,13 @@ IceUtilInternal::FileLock::FileLock(const std::string& path) : overlaped.InternalHigh = 0; overlaped.Offset = 0; overlaped.OffsetHigh = 0; + +#if defined(_MSC_VER) && (_MSC_VER >= 1600) overlaped.hEvent = nullptr; +#else + overlaped.hEvent = 0; +#endif + if(::LockFileEx(_fd, LOCKFILE_EXCLUSIVE_LOCK | LOCKFILE_FAIL_IMMEDIATELY, 0, 0, 0, &overlaped) == 0) { ::CloseHandle(_fd); @@ -216,8 +222,8 @@ IceUtilInternal::FileLock::FileLock(const std::string& path) : } #endif // - // In Windows implementation we don't write the process pid to the file, as is - // not posible to read the file from other process while it is locked here. + // In Windows implementation we don't write the process pid to the file, as it is + // not possible to read the file from other process while it is locked here. // } -- cgit v1.2.3