mirror of
https://github.com/boostorg/atomic.git
synced 2026-01-25 18:12:08 +00:00
We need to explicitly link with synchronization.lib when the WaitOnAddress API is enabled at compile time for ARM targets. Since this library is only available on newer Windows SDKs, we have to perform a configure check for whether it is available.
34 lines
964 B
C++
34 lines
964 B
C++
/*
|
|
* Distributed under the Boost Software License, Version 1.0.
|
|
* (See accompanying file LICENSE_1_0.txt or copy at
|
|
* http://www.boost.org/LICENSE_1_0.txt)
|
|
*
|
|
* Copyright (c) 2020 Andrey Semashev
|
|
*/
|
|
|
|
#define BOOST_USE_WINAPI_VERSION 0x0602
|
|
|
|
// Include Boost.Predef first so that windows.h is guaranteed to be not included
|
|
#include <boost/predef/os/windows.h>
|
|
#include <boost/predef/os/cygwin.h>
|
|
#if !BOOST_OS_WINDOWS && !BOOST_OS_CYGWIN
|
|
#error "This config test is for Windows only"
|
|
#endif
|
|
|
|
#include <boost/winapi/config.hpp>
|
|
#include <boost/predef/platform.h>
|
|
#if !(BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN8 && (BOOST_WINAPI_PARTITION_APP || BOOST_WINAPI_PARTITION_SYSTEM))
|
|
#error "No WaitOnAddress API"
|
|
#endif
|
|
|
|
#include <cstddef>
|
|
#include <boost/winapi/basic_types.hpp>
|
|
#include <boost/winapi/wait_on_address.hpp>
|
|
|
|
int main()
|
|
{
|
|
unsigned int n = 0u, compare = 0u;
|
|
boost::winapi::WaitOnAddress(&n, &compare, sizeof(n), 0);
|
|
return 0;
|
|
}
|