mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-24 21:39:00 +08:00
82 lines
2.5 KiB
Diff
82 lines
2.5 KiB
Diff
|
From bf08155d16ea8c359d1bfab6bac684cdfada4a5b Mon Sep 17 00:00:00 2001
|
||
|
From: Andrey Semashev <andrey.semashev@gmail.com>
|
||
|
Date: Wed, 15 Dec 2021 02:06:11 +0300
|
||
|
Subject: [PATCH] Fix compilation for UWP.
|
||
|
|
||
|
UWP does not support APIs related to dynamic symbol binding and dlls.
|
||
|
Disable runtime detection of WaitOnAddress & co. for that target. These
|
||
|
APIs should be enabled at compile time on Windows 8.
|
||
|
|
||
|
Fixes https://github.com/boostorg/atomic/issues/54.
|
||
|
---
|
||
|
doc/changelog.qbk | 4 ++++
|
||
|
src/wait_on_address.cpp | 16 ++++++++++++++++
|
||
|
2 files changed, 20 insertions(+)
|
||
|
|
||
|
diff --git a/doc/changelog.qbk b/doc/changelog.qbk
|
||
|
index 9c370c9..ffbd902 100644
|
||
|
--- a/doc/changelog.qbk
|
||
|
+++ b/doc/changelog.qbk
|
||
|
@@ -7,6 +7,10 @@
|
||
|
|
||
|
[section:changelog Changelog]
|
||
|
|
||
|
+[heading Boost 1.79]
|
||
|
+
|
||
|
+* Fixed compilation for Universal Windows Platform (UWP). ([github_issue 54])
|
||
|
+
|
||
|
[heading Boost 1.78]
|
||
|
|
||
|
* Use process-local futex operations on Android for non-IPC waiting and notifying operations.
|
||
|
diff --git a/src/wait_on_address.cpp b/src/wait_on_address.cpp
|
||
|
index 7cf5bd0..6f8a165 100644
|
||
|
--- a/src/wait_on_address.cpp
|
||
|
+++ b/src/wait_on_address.cpp
|
||
|
@@ -25,6 +25,8 @@
|
||
|
#include <boost/atomic/detail/once_flag.hpp>
|
||
|
#include <boost/atomic/detail/wait_on_address.hpp>
|
||
|
|
||
|
+#if BOOST_WINAPI_PARTITION_DESKTOP || BOOST_WINAPI_PARTITION_SYSTEM
|
||
|
+
|
||
|
#include <boost/static_assert.hpp>
|
||
|
#include <boost/memory_order.hpp>
|
||
|
#include <boost/winapi/thread.hpp>
|
||
|
@@ -33,6 +35,8 @@
|
||
|
|
||
|
#include <boost/atomic/detail/core_operations.hpp>
|
||
|
|
||
|
+#endif // BOOST_WINAPI_PARTITION_DESKTOP || BOOST_WINAPI_PARTITION_SYSTEM
|
||
|
+
|
||
|
#include <boost/atomic/detail/header.hpp>
|
||
|
|
||
|
namespace boost {
|
||
|
@@ -43,6 +47,8 @@ BOOST_ATOMIC_DECL wait_on_address_t* wait_on_address = NULL;
|
||
|
BOOST_ATOMIC_DECL wake_by_address_t* wake_by_address_single = NULL;
|
||
|
BOOST_ATOMIC_DECL wake_by_address_t* wake_by_address_all = NULL;
|
||
|
|
||
|
+#if BOOST_WINAPI_PARTITION_DESKTOP || BOOST_WINAPI_PARTITION_SYSTEM
|
||
|
+
|
||
|
BOOST_ATOMIC_DECL once_flag wait_functions_once_flag = { 2u };
|
||
|
|
||
|
BOOST_ATOMIC_DECL void initialize_wait_functions() BOOST_NOEXCEPT
|
||
|
@@ -90,6 +96,16 @@ BOOST_ATOMIC_DECL void initialize_wait_functions() BOOST_NOEXCEPT
|
||
|
}
|
||
|
}
|
||
|
|
||
|
+#else // BOOST_WINAPI_PARTITION_DESKTOP || BOOST_WINAPI_PARTITION_SYSTEM
|
||
|
+
|
||
|
+BOOST_ATOMIC_DECL once_flag wait_functions_once_flag = { 0u };
|
||
|
+
|
||
|
+BOOST_ATOMIC_DECL void initialize_wait_functions() BOOST_NOEXCEPT
|
||
|
+{
|
||
|
+}
|
||
|
+
|
||
|
+#endif // BOOST_WINAPI_PARTITION_DESKTOP || BOOST_WINAPI_PARTITION_SYSTEM
|
||
|
+
|
||
|
} // namespace detail
|
||
|
} // namespace atomics
|
||
|
} // namespace boost
|
||
|
--
|
||
|
2.34.1.windows.1
|
||
|
|