Fixed windows defines for *LIST*
authorArmin Novak <armin.novak@thincast.com>
Wed, 10 Aug 2016 10:39:26 +0000 (12:39 +0200)
committerArmin Novak <armin.novak@thincast.com>
Thu, 6 Oct 2016 11:43:10 +0000 (13:43 +0200)
winpr/include/winpr/interlocked.h
winpr/libwinpr/interlocked/test/TestInterlockedSList.c
winpr/libwinpr/synch/test/TestSynchBarrier.c

index f622f91..96a83e2 100644 (file)
@@ -77,9 +77,9 @@ typedef struct DECLSPEC_ALIGN(16) _WINPR_SLIST_ENTRY
 
 #else  /* _WIN64 */
 
-#define WINPR_SLIST_ENTRY WINPR_SINGLE_LIST_ENTRY
-#define _WINPR_SLIST_ENTRY _WINPR_SINGLE_LIST_ENTRY
-#define PWINPR_SLIST_ENTRY WINPR_PSINGLE_LIST_ENTRY
+#define WINPR_SLIST_ENTRY SINGLE_LIST_ENTRY
+#define _WINPR_SLIST_ENTRY _SINGLE_LIST_ENTRY
+#define WINPR_PSLIST_ENTRY PSINGLE_LIST_ENTRY
 
 #endif /* _WIN64 */
 
@@ -134,10 +134,10 @@ typedef union _WINPR_SLIST_HEADER
 
 WINPR_API VOID InitializeSListHead(WINPR_PSLIST_HEADER ListHead);
 
-WINPR_API PWINPR_SLIST_ENTRY InterlockedPushEntrySList(WINPR_PSLIST_HEADER ListHead, PWINPR_SLIST_ENTRY ListEntry);
-WINPR_API PWINPR_SLIST_ENTRY InterlockedPushListSListEx(WINPR_PSLIST_HEADER ListHead, PWINPR_SLIST_ENTRY List, PWINPR_SLIST_ENTRY ListEnd, ULONG Count);
-WINPR_API PWINPR_SLIST_ENTRY InterlockedPopEntrySList(WINPR_PSLIST_HEADER ListHead);
-WINPR_API PWINPR_SLIST_ENTRY InterlockedFlushSList(WINPR_PSLIST_HEADER ListHead);
+WINPR_API WINPR_PSLIST_ENTRY InterlockedPushEntrySList(WINPR_PSLIST_HEADER ListHead, WINPR_PSLIST_ENTRY ListEntry);
+WINPR_API WINPR_PSLIST_ENTRY InterlockedPushListSListEx(WINPR_PSLIST_HEADER ListHead, WINPR_PSLIST_ENTRY List, WINPR_PSLIST_ENTRY ListEnd, ULONG Count);
+WINPR_API WINPR_PSLIST_ENTRY InterlockedPopEntrySList(WINPR_PSLIST_HEADER ListHead);
+WINPR_API WINPR_PSLIST_ENTRY InterlockedFlushSList(WINPR_PSLIST_HEADER ListHead);
 
 WINPR_API USHORT QueryDepthSList(WINPR_PSLIST_HEADER ListHead);
 
@@ -151,6 +151,23 @@ WINPR_API LONG InterlockedCompareExchange(LONG volatile *Destination, LONG Excha
 
 WINPR_API PVOID InterlockedCompareExchangePointer(PVOID volatile *Destination, PVOID Exchange, PVOID Comperand);
 
+#else /* _WIN32 */
+#define WINPR_LIST_ENTRY LIST_ENTRY
+#define _WINPR_LIST_ENTRY _LIST_ENTRY
+#define WINPR_PLIST_ENTRY PLIST_ENTRY
+
+#define WINPR_SINGLE_LIST_ENTRY SINGLE_LIST_ENTRY
+#define _WINPR_SINGLE_LIST_ENTRY _SINGLE_LIST_ENTRY
+#define WINPR_PSINGLE_LIST_ENTRY PSINGLE_LIST_ENTRY
+
+#define WINPR_SLIST_ENTRY SLIST_ENTRY
+#define _WINPR_SLIST_ENTRY _SLIST_ENTRY
+#define WINPR_PSLIST_ENTRY PSLIST_ENTRY
+
+#define WINPR_SLIST_HEADER SLIST_HEADER
+#define _WINPR_SLIST_HEADER _SLIST_HEADER
+#define WINPR_PSLIST_HEADER PSLIST_HEADER
+
 #endif /* _WIN32 */
 
 #if (!defined(_WIN32) || (defined(_WIN32) && (_WIN32_WINNT < 0x0502) && !defined(InterlockedCompareExchange64)))
index 5ceadbc..33390d0 100644 (file)
@@ -13,13 +13,13 @@ typedef struct _PROGRAM_ITEM
 int TestInterlockedSList(int argc, char* argv[])
 {
        ULONG Count;
-    PWINPR_SLIST_ENTRY pFirstEntry;
-    PWINPR_SLIST_ENTRY pListEntry;
-    WINPR_PSLIST_HEADER pListHead;
+       WINPR_PSLIST_ENTRY pFirstEntry;
+       WINPR_PSLIST_ENTRY pListEntry;
+       WINPR_PSLIST_HEADER pListHead;
        PPROGRAM_ITEM pProgramItem;
 
        /* Initialize the list header to a MEMORY_ALLOCATION_ALIGNMENT boundary. */
-    pListHead = (WINPR_PSLIST_HEADER) _aligned_malloc(sizeof(WINPR_SLIST_HEADER), MEMORY_ALLOCATION_ALIGNMENT);
+       pListHead = (WINPR_PSLIST_HEADER) _aligned_malloc(sizeof(WINPR_SLIST_HEADER), MEMORY_ALLOCATION_ALIGNMENT);
 
        if (!pListHead)
        {
index 4a40fd2..a8b86ed 100644 (file)
@@ -70,7 +70,7 @@ BOOL TestSynchBarrierWithFlags(DWORD dwFlags, DWORD dwThreads, DWORD dwLoops)
        HANDLE* threads;
        struct test_params p;
        DWORD dwStatus, expectedTrueCount, expectedFalseCount;
-       int i;
+       DWORD i;
        p.threadCount = 0;
        p.trueCount   = 0;
        p.falseCount  = 0;