From 9f8c5488c29c563c5e3662141f498c20d78db28a Mon Sep 17 00:00:00 2001 From: Jan Date: Wed, 6 Dec 2017 18:43:12 +0100 Subject: [PATCH] fix Windows ifdefs (#3824) --- arangod/RocksDBEngine/RocksDBThrottle.cpp | 8 ++++---- arangod/RocksDBEngine/RocksDBThrottle.h | 2 +- arangod/Scheduler/SchedulerFeature.cpp | 8 +++----- lib/ApplicationFeatures/RocksDBOptionFeature.cpp | 2 +- lib/Basics/tri-zip.cpp | 2 +- 5 files changed, 10 insertions(+), 12 deletions(-) diff --git a/arangod/RocksDBEngine/RocksDBThrottle.cpp b/arangod/RocksDBEngine/RocksDBThrottle.cpp index 8c4eb0cf89..4a6377ef29 100644 --- a/arangod/RocksDBEngine/RocksDBThrottle.cpp +++ b/arangod/RocksDBEngine/RocksDBThrottle.cpp @@ -34,7 +34,7 @@ #include "RocksDBThrottle.h" -#ifndef WIN32 +#ifndef _WIN32 #include #include #endif @@ -155,11 +155,11 @@ void RocksDBThrottle::StopThread() { /// @brief CompactionEventListener::OnCompaction() will get called for every key in a /// compaction. We only need the "level" parameter to see if thread priority should change. /// -#ifndef WIN32 +#ifndef _WIN32 CompactionEventListener * RocksDBThrottle::GetCompactionEventListener() {return &gCompactionListener;}; #else CompactionEventListener * RocksDBThrottle::GetCompactionEventListener() {return nullptr;}; -#endif // WIN32 +#endif // _WIN32 /// /// @brief rocksdb does not track flush time in its statistics. Save start time in @@ -486,7 +486,7 @@ int64_t RocksDBThrottle::ComputeBacklog() { /// @brief Adjust the active thread's priority to match the work /// it is performing. The routine is called HEAVILY. void RocksDBThrottle::AdjustThreadPriority(int Adjustment) { -#ifndef WIN32 +#ifndef _WIN32 // initialize thread infor if this the first time the thread has ever called if (!gThreadPriority._baseSet) { pid_t tid; diff --git a/arangod/RocksDBEngine/RocksDBThrottle.h b/arangod/RocksDBEngine/RocksDBThrottle.h index 2371f0c5b4..7832b32ae6 100644 --- a/arangod/RocksDBEngine/RocksDBThrottle.h +++ b/arangod/RocksDBEngine/RocksDBThrottle.h @@ -51,7 +51,7 @@ // ugliness starts here ... this will go away if rocksdb adds pluggable write_controller. // need either ROCKSDB_PLATFORM_POSIX or OS_WIN set before the includes using namespace rocksdb; -#ifndef WIN32 +#ifndef _WIN32 #define ROCKSDB_PLATFORM_POSIX 1 #else #define OS_WIN 1 diff --git a/arangod/Scheduler/SchedulerFeature.cpp b/arangod/Scheduler/SchedulerFeature.cpp index 2c88675cf8..f45b81a0be 100644 --- a/arangod/Scheduler/SchedulerFeature.cpp +++ b/arangod/Scheduler/SchedulerFeature.cpp @@ -160,7 +160,7 @@ void SchedulerFeature::stop() { exitSignals->cancel(); } -#ifndef WIN32 +#ifndef _WIN32 if (_hangupSignals != nullptr) { _hangupSignals->cancel(); _hangupSignals.reset(); @@ -271,7 +271,7 @@ void SchedulerFeature::buildScheduler() { } void SchedulerFeature::buildControlCHandler() { -#ifdef WIN32 +#ifdef _WIN32 { int result = SetConsoleCtrlHandler((PHANDLER_ROUTINE)CtrlHandler, true); @@ -281,7 +281,6 @@ void SchedulerFeature::buildControlCHandler() { } #else -#ifndef WIN32 // Signal masking on POSIX platforms // // POSIX allows signals to be blocked using functions such as sigprocmask() @@ -291,7 +290,6 @@ void SchedulerFeature::buildControlCHandler() { sigset_t all; sigemptyset(&all); pthread_sigmask(SIG_SETMASK, &all, 0); -#endif auto ioService = _scheduler->managerService(); _exitSignals = std::make_shared(*ioService, SIGINT, @@ -326,7 +324,7 @@ void SchedulerFeature::buildControlCHandler() { } void SchedulerFeature::buildHangupHandler() { -#ifndef WIN32 +#ifndef _WIN32 auto ioService = _scheduler->managerService(); _hangupSignals = diff --git a/lib/ApplicationFeatures/RocksDBOptionFeature.cpp b/lib/ApplicationFeatures/RocksDBOptionFeature.cpp index 69f593e0f6..0698361a91 100644 --- a/lib/ApplicationFeatures/RocksDBOptionFeature.cpp +++ b/lib/ApplicationFeatures/RocksDBOptionFeature.cpp @@ -86,7 +86,7 @@ RocksDBOptionFeature::RocksDBOptionFeature( // setting the number of background jobs to _maxBackgroundJobs = static_cast(std::max((size_t)2, std::min(TRI_numberProcessors(), (size_t)8))); -#ifdef WIN32 +#ifdef _WIN32 // Windows code does not (yet) support lowering thread priority of // compactions. Therefore it is possible for rocksdb to use all // CPU time on compactions. Essential network communications can be lost. diff --git a/lib/Basics/tri-zip.cpp b/lib/Basics/tri-zip.cpp index 500897a44b..7c4ef2e861 100644 --- a/lib/Basics/tri-zip.cpp +++ b/lib/Basics/tri-zip.cpp @@ -83,7 +83,7 @@ static int ExtractCurrentFile(unzFile uf, void* buffer, size_t const bufferSize, // adjust file name p = filenameInZip; while (*p != '\0') { -#ifdef WIN32 +#ifdef _WIN32 if (*p == '/') { *p = '\\'; }