diff --git a/include/boost/smart_ptr/detail/yield_k.hpp b/include/boost/smart_ptr/detail/yield_k.hpp index e32d5aa..403f32f 100644 --- a/include/boost/smart_ptr/detail/yield_k.hpp +++ b/include/boost/smart_ptr/detail/yield_k.hpp @@ -68,20 +68,15 @@ namespace detail # define BOOST_SP_STDCALL __stdcall #endif -#if !BOOST_COMP_CLANG || !defined __MINGW32__ - extern "C" void BOOST_SP_STDCALL Sleep( unsigned long ms ); -#else -#include <_mingw.h> -#if !defined __MINGW64_VERSION_MAJOR - extern "C" void BOOST_SP_STDCALL Sleep( unsigned long ms ); +#if defined(__LP64__) // Cygwin 64 + extern "C" __declspec(dllimport) void BOOST_SP_STDCALL Sleep( unsigned int ms ); #else extern "C" __declspec(dllimport) void BOOST_SP_STDCALL Sleep( unsigned long ms ); #endif -#endif #undef BOOST_SP_STDCALL -#endif +#endif // !defined( BOOST_USE_WINDOWS_H ) && !BOOST_PLAT_WINDOWS_RUNTIME inline void yield( unsigned k ) { diff --git a/test/Jamfile b/test/Jamfile index c9c7b67..6cff91a 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -272,3 +272,7 @@ run lsp_convertible_test2.cpp ; run make_shared_array_tmp_test.cpp ; run lw_thread_test.cpp : : : multi ; + +compile sp_windows_h_test.cpp ; +compile spinlock_windows_h_test.cpp ; +compile yield_k_windows_h_test.cpp ; diff --git a/test/sp_windows_h_test.cpp b/test/sp_windows_h_test.cpp new file mode 100644 index 0000000..b4df132 --- /dev/null +++ b/test/sp_windows_h_test.cpp @@ -0,0 +1,11 @@ +// Copyright 2018 Peter Dimov +// Distributed under the Boost Software License, Version 1.0. + +#if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# include +# include +#endif + +int main() +{ +} diff --git a/test/spinlock_windows_h_test.cpp b/test/spinlock_windows_h_test.cpp new file mode 100644 index 0000000..68a8781 --- /dev/null +++ b/test/spinlock_windows_h_test.cpp @@ -0,0 +1,11 @@ +// Copyright 2018 Peter Dimov +// Distributed under the Boost Software License, Version 1.0. + +#if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# include +# include +#endif + +int main() +{ +} diff --git a/test/yield_k_windows_h_test.cpp b/test/yield_k_windows_h_test.cpp new file mode 100644 index 0000000..c2f88b8 --- /dev/null +++ b/test/yield_k_windows_h_test.cpp @@ -0,0 +1,11 @@ +// Copyright 2018 Peter Dimov +// Distributed under the Boost Software License, Version 1.0. + +#if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# include +# include +#endif + +int main() +{ +}