You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by jo...@apache.org on 2016/03/11 18:05:18 UTC
[4/8] mesos git commit: Windows: Fixed `UUID::random` and added
utime/touch to stout/os.hpp.
Windows: Fixed `UUID::random` and added utime/touch to stout/os.hpp.
Review: https://reviews.apache.org/r/44042/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/8806544b
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/8806544b
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/8806544b
Branch: refs/heads/master
Commit: 8806544b336555479904427bf50b5961549ba1fb
Parents: 7b8d989
Author: Alex Clemmer <cl...@gmail.com>
Authored: Fri Mar 11 11:28:59 2016 -0500
Committer: Joris Van Remoortere <jo...@gmail.com>
Committed: Fri Mar 11 12:03:47 2016 -0500
----------------------------------------------------------------------
.../libprocess/3rdparty/stout/include/stout/os.hpp | 2 ++
.../3rdparty/stout/include/stout/posix/os.hpp | 2 --
.../libprocess/3rdparty/stout/include/stout/uuid.hpp | 4 ++++
.../3rdparty/stout/include/stout/windows.hpp | 15 ++++++++++++++-
4 files changed, 20 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/8806544b/3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp
index a3c21e4..79e30ca 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp
@@ -56,6 +56,8 @@
#include <stout/os/shell.hpp>
#include <stout/os/stat.hpp>
#include <stout/os/su.hpp>
+#include <stout/os/touch.hpp>
+#include <stout/os/utime.hpp>
// For readability, we minimize the number of #ifdef blocks in the code by
// splitting platform specifc system calls into separate directories.
http://git-wip-us.apache.org/repos/asf/mesos/blob/8806544b/3rdparty/libprocess/3rdparty/stout/include/stout/posix/os.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/posix/os.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/posix/os.hpp
index 0b23957..9ee233b 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/stout/posix/os.hpp
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/posix/os.hpp
@@ -64,8 +64,6 @@
#include <stout/os/sendfile.hpp>
#include <stout/os/signals.hpp>
#include <stout/os/strerror.hpp>
-#include <stout/os/touch.hpp>
-#include <stout/os/utime.hpp>
#include <stout/os/write.hpp>
#ifdef __FreeBSD__
http://git-wip-us.apache.org/repos/asf/mesos/blob/8806544b/3rdparty/libprocess/3rdparty/stout/include/stout/uuid.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/uuid.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/uuid.hpp
index 6256365..e3cf21f 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/stout/uuid.hpp
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/uuid.hpp
@@ -24,6 +24,10 @@
#include <stout/thread_local.hpp>
+#ifdef __WINDOWS__
+#include <stout/windows.hpp>
+#endif // __WINDOWS__
+
// NOTE: This namespace is necessary because the standard Windows headers
// define a UUID struct in the global namespace for the DCE RPC API. We put
// this in the `id::` namespace to avoid collisions. Note also that we include
http://git-wip-us.apache.org/repos/asf/mesos/blob/8806544b/3rdparty/libprocess/3rdparty/stout/include/stout/windows.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/windows.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/windows.hpp
index d3ba0b4..ee13d12 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/stout/windows.hpp
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/windows.hpp
@@ -112,7 +112,20 @@ inline BOOL GetMessage(
{
return GetMessageWindows(lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax);
}
-#endif
+#endif // GetMessage
+
+
+// Zookeeper's native `winconfig.h` defines a macro `random` to point at
+// `rand`. This inteferes with `UUID::rand`, so we redfine it as a global
+// function in a manner similar to the `GetMessage` macro above. See the
+// accompanying comment for rationale.
+#ifdef random
+#undef random
+inline int random()
+{
+ return rand();
+}
+#endif // random
// Define constants used for Windows compat. Allows a lot of code on