From 57f14808d82b36b06406d8cdcf4ce27039619966 Mon Sep 17 00:00:00 2001 From: Alden Torres Date: Wed, 29 Jul 2015 14:56:31 -0400 Subject: [PATCH] Restore the option to compile with target Windows XP. --- Jamfile | 3 ++- src/thread.cpp | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Jamfile b/Jamfile index c7f86c033..0fc982497 100644 --- a/Jamfile +++ b/Jamfile @@ -413,9 +413,10 @@ feature.compose production : TORRENT_PRODUCTION_ASSERTS=1 off : TORRENT_USE_ASSERTS=0 ; feature.compose system : TORRENT_USE_SYSTEM_ASSERTS=1 ; -feature windows-version : vista win7 : composite propagated link-incompatible ; +feature windows-version : vista win7 xp : composite propagated link-incompatible ; feature.compose vista : _WIN32_WINNT=0x0600 ; feature.compose win7 : _WIN32_WINNT=0x0601 ; +feature.compose xp : _WIN32_WINNT=0x0501 ; feature extensions : on off : composite propagated link-incompatible ; feature.compose off : TORRENT_DISABLE_EXTENSIONS ; diff --git a/src/thread.cpp b/src/thread.cpp index 18dc1136d..8b60ede9a 100644 --- a/src/thread.cpp +++ b/src/thread.cpp @@ -105,7 +105,11 @@ namespace libtorrent condition_variable::condition_variable() : m_num_waiters(0) { +#if _WIN32_WINNT == 0x0501 + m_sem = CreateSemaphore(0, 0, INT_MAX, 0); +#else m_sem = CreateSemaphoreEx(0, 0, INT_MAX, 0, 0, SEMAPHORE_ALL_ACCESS); +#endif } condition_variable::~condition_variable()