winpr: fix definitions of synchronization barrier and interlocked functions

This commit is contained in:
Marc-André Moreau 2016-05-11 13:12:44 -04:00
parent 0d1553942e
commit d4c809c4ae
3 changed files with 8 additions and 3 deletions

View File

@ -158,7 +158,7 @@ WINPR_API PVOID InterlockedCompareExchangePointer(PVOID volatile *Destination, P
#endif /* _WIN32 */
#if (!defined(_WIN32) || (defined(_WIN32) && !defined(_M_AMD64) && (_WIN32_WINNT < 0x0502)))
#if (!defined(_WIN32) || (defined(_WIN32) && (_WIN32_WINNT < 0x0502) && !defined(InterlockedCompareExchange64)))
#define WINPR_INTERLOCKED_COMPARE_EXCHANGE64 1
#endif

View File

@ -329,7 +329,11 @@ WINPR_API VOID InitOnceInitialize(PINIT_ONCE InitOnce);
/* Synchronization Barrier */
#if (!defined(_WIN32)) || (defined(_WIN32) && (_WIN32_WINNT < 0x0602))
#if (!defined(_WIN32)) || (defined(_WIN32) && (_WIN32_WINNT < 0x0602) && !defined(_SYNCHAPI_H_))
#define WINPR_SYNCHRONIZATION_BARRIER 1
#endif
#ifdef WINPR_SYNCHRONIZATION_BARRIER
typedef struct _RTL_BARRIER
{
@ -353,6 +357,7 @@ WINPR_API BOOL WINAPI EnterSynchronizationBarrier(LPSYNCHRONIZATION_BARRIER lpBa
WINPR_API BOOL WINAPI DeleteSynchronizationBarrier(LPSYNCHRONIZATION_BARRIER lpBarrier);
#endif
/* Extended API */
WINPR_API VOID USleep(DWORD dwMicroseconds);

View File

@ -27,7 +27,7 @@
#include <winpr/crt.h>
#if (!defined(_WIN32)) || (defined(_WIN32) && (_WIN32_WINNT < 0x0602))
#ifdef WINPR_SYNCHRONIZATION_BARRIER
#include <winpr/library.h>
#include <winpr/interlocked.h>