Windows: Deleted `stout/os/windows/signals.hpp`. This file had never been included before, so it didn't compile. Because everything in this file will remain unimplemented, we chose to delete the Windows version of the file entirely. The POSIX implementation is left intact in `stout/os/posix/signals.hpp`, and the primary header, `stout/os/signals.hpp` is a no-op on Windows. We do this so that its inclusion does not need to be guarded, only the use of the POSIX-specific APIs under `os::signals`.
Review: https://reviews.apache.org/r/66444 Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/e765f8fa Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/e765f8fa Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/e765f8fa Branch: refs/heads/master Commit: e765f8fab84dba81d44c71024da1d2cef56b3ad5 Parents: d9edabe Author: Andrew Schwartzmeyer <[email protected]> Authored: Tue Apr 3 14:34:03 2018 -0700 Committer: Andrew Schwartzmeyer <[email protected]> Committed: Tue May 1 18:36:04 2018 -0700 ---------------------------------------------------------------------- 3rdparty/stout/include/Makefile.am | 1 - 3rdparty/stout/include/stout/os/signals.hpp | 12 +-- .../stout/include/stout/os/windows/signals.hpp | 90 -------------------- 3 files changed, 7 insertions(+), 96 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/e765f8fa/3rdparty/stout/include/Makefile.am ---------------------------------------------------------------------- diff --git a/3rdparty/stout/include/Makefile.am b/3rdparty/stout/include/Makefile.am index b2fc52e..f2e6022 100644 --- a/3rdparty/stout/include/Makefile.am +++ b/3rdparty/stout/include/Makefile.am @@ -193,7 +193,6 @@ nobase_include_HEADERS = \ stout/os/windows/rmdir.hpp \ stout/os/windows/sendfile.hpp \ stout/os/windows/shell.hpp \ - stout/os/windows/signals.hpp \ stout/os/windows/socket.hpp \ stout/os/windows/stat.hpp \ stout/os/windows/su.hpp \ http://git-wip-us.apache.org/repos/asf/mesos/blob/e765f8fa/3rdparty/stout/include/stout/os/signals.hpp ---------------------------------------------------------------------- diff --git a/3rdparty/stout/include/stout/os/signals.hpp b/3rdparty/stout/include/stout/os/signals.hpp index 30e0f63..36a704e 100644 --- a/3rdparty/stout/include/stout/os/signals.hpp +++ b/3rdparty/stout/include/stout/os/signals.hpp @@ -16,16 +16,18 @@ // For readability, we minimize the number of #ifdef blocks in the code by // splitting platform specific system calls into separate directories. -#ifdef __WINDOWS__ -#include <stout/os/windows/signals.hpp> -#else +// +// NOTE: The `os::signals` namespace is not, and will not be, +// implemented on Windows. We do not throw an error error here so that +// the inclusion of this header does not need to guarded; however, +// uses of `os::signals` will need to be guarded. +#ifndef __WINDOWS__ #include <stout/os/posix/signals.hpp> -#endif // __WINDOWS__ - #define SUPPRESS(signal) \ if (os::signals::internal::Suppressor suppressor ## signal = \ os::signals::internal::Suppressor(signal)) +#endif // __WINDOWS__ #endif // __STOUT_OS_SIGNALS_HPP__ http://git-wip-us.apache.org/repos/asf/mesos/blob/e765f8fa/3rdparty/stout/include/stout/os/windows/signals.hpp ---------------------------------------------------------------------- diff --git a/3rdparty/stout/include/stout/os/windows/signals.hpp b/3rdparty/stout/include/stout/os/windows/signals.hpp deleted file mode 100644 index 0ed2477..0000000 --- a/3rdparty/stout/include/stout/os/windows/signals.hpp +++ /dev/null @@ -1,90 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef __STOUT_OS_WINDOWS_SIGNALS_HPP__ -#define __STOUT_OS_WINDOWS_SIGNALS_HPP__ - -#include <errno.h> -#include <signal.h> -#include <string.h> - - -namespace os { - -namespace signals { - -// Installs the given signal handler. -inline int install(int signal, void(*handler)(int)) -{ - UNIMPLEMENTED; -} - - -// Resets the signal handler to the default handler of the signal. -inline int reset(int signal) -{ - UNIMPLEMENTED; -} - - -// Returns true iff the signal is pending. -inline bool pending(int signal) -{ - UNIMPLEMENTED; -} - - -// Returns true if the signal has been blocked, or false if the -// signal was already blocked. -inline bool block(int signal) -{ - UNIMPLEMENTED; -} - - -// Returns true if the signal has been unblocked, or false if the -// signal was not previously blocked. -inline bool unblock(int signal) -{ - UNIMPLEMENTED; -} - -namespace internal { - -// Suppresses a signal on the current thread for the lifetime of -// the Suppressor. The signal *must* be synchronous and delivered -// per-thread. The suppression occurs only on the thread of -// execution of the Suppressor. -struct Suppressor -{ - Suppressor(int _signal) - : signal(_signal), pending(false), unblock(false) - { - UNIMPLEMENTED; - } - - ~Suppressor() - { - UNIMPLEMENTED; - } - - // Needed for the SUPPRESS() macro. - operator bool() { return true; } -}; - -} // namespace internal { - -} // namespace signals { - -} // namespace os { - -#endif // __STOUT_OS_WINDOWS_SIGNALS_HPP__
