ntdll: Fix compilation on systems that don't support nameless structs.

This commit is contained in:
Francois Gouget 2007-02-12 15:05:51 +01:00 committed by Alexandre Julliard
parent 76e258cb53
commit fff13d2751
2 changed files with 22 additions and 21 deletions

View File

@ -31,6 +31,7 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include "ntstatus.h" #include "ntstatus.h"
#define NONAMELESSSTRUCT
#define WIN32_NO_STATUS #define WIN32_NO_STATUS
#include "windef.h" #include "windef.h"
#include "winternl.h" #include "winternl.h"
@ -944,7 +945,7 @@ WORD WINAPI RtlQueryDepthSList(PSLIST_HEADER ListHeader)
FIXME("stub\n"); FIXME("stub\n");
return NULL; return NULL;
#else #else
return ListHeader->Depth; return ListHeader->s.Depth;
#endif #endif
} }
@ -955,7 +956,7 @@ PSLIST_ENTRY WINAPI RtlFirstEntrySList(const SLIST_HEADER* ListHeader)
FIXME("stub\n"); FIXME("stub\n");
return NULL; return NULL;
#else #else
return ListHeader->Next.Next; return ListHeader->s.Next.Next;
#endif #endif
} }
@ -967,17 +968,17 @@ PSLIST_ENTRY WINAPI RtlInterlockedFlushSList(PSLIST_HEADER ListHeader)
FIXME("stub\n"); FIXME("stub\n");
return NULL; return NULL;
#else #else
if (ListHeader->Depth == 0) if (ListHeader->s.Depth == 0)
return NULL; return NULL;
newHeader.Alignment = 0; newHeader.Alignment = 0;
do do
{ {
oldHeader = *ListHeader; oldHeader = *ListHeader;
newHeader.Sequence = ListHeader->Sequence + 1; newHeader.s.Sequence = ListHeader->s.Sequence + 1;
} while (interlocked_cmpxchg64((__int64*)&ListHeader->Alignment, } while (interlocked_cmpxchg64((__int64*)&ListHeader->Alignment,
newHeader.Alignment, newHeader.Alignment,
oldHeader.Alignment) != oldHeader.Alignment); oldHeader.Alignment) != oldHeader.Alignment);
return oldHeader.Next.Next; return oldHeader.s.Next.Next;
#endif #endif
} }
@ -990,17 +991,17 @@ PSLIST_ENTRY WINAPI RtlInterlockedPushEntrySList(PSLIST_HEADER ListHeader,
FIXME("stub\n"); FIXME("stub\n");
return NULL; return NULL;
#else #else
newHeader.Next.Next = ListEntry; newHeader.s.Next.Next = ListEntry;
do do
{ {
oldHeader = *ListHeader; oldHeader = *ListHeader;
ListEntry->Next = ListHeader->Next.Next; ListEntry->Next = ListHeader->s.Next.Next;
newHeader.Depth = ListHeader->Depth + 1; newHeader.s.Depth = ListHeader->s.Depth + 1;
newHeader.Sequence = ListHeader->Sequence + 1; newHeader.s.Sequence = ListHeader->s.Sequence + 1;
} while (interlocked_cmpxchg64((__int64*)&ListHeader->Alignment, } while (interlocked_cmpxchg64((__int64*)&ListHeader->Alignment,
newHeader.Alignment, newHeader.Alignment,
oldHeader.Alignment) != oldHeader.Alignment); oldHeader.Alignment) != oldHeader.Alignment);
return oldHeader.Next.Next; return oldHeader.s.Next.Next;
#endif #endif
} }
@ -1016,15 +1017,15 @@ PSLIST_ENTRY WINAPI RtlInterlockedPopEntrySList(PSLIST_HEADER ListHeader)
do do
{ {
oldHeader = *ListHeader; oldHeader = *ListHeader;
entry = ListHeader->Next.Next; entry = ListHeader->s.Next.Next;
if (entry == NULL) if (entry == NULL)
return NULL; return NULL;
/* entry could be deleted by another thread */ /* entry could be deleted by another thread */
__TRY __TRY
{ {
newHeader.Next.Next = entry->Next; newHeader.s.Next.Next = entry->Next;
newHeader.Depth = ListHeader->Depth - 1; newHeader.s.Depth = ListHeader->s.Depth - 1;
newHeader.Sequence = ListHeader->Sequence + 1; newHeader.s.Sequence = ListHeader->s.Sequence + 1;
} }
__EXCEPT_PAGE_FAULT __EXCEPT_PAGE_FAULT
{ {
@ -1051,16 +1052,16 @@ PSLIST_ENTRY WINAPI RtlInterlockedPushListSList(PSLIST_HEADER ListHeader,
FIXME("stub\n"); FIXME("stub\n");
return NULL; return NULL;
#else #else
newHeader.Next.Next = FirstEntry; newHeader.s.Next.Next = FirstEntry;
do do
{ {
oldHeader = *ListHeader; oldHeader = *ListHeader;
newHeader.Depth = ListHeader->Depth + Count; newHeader.s.Depth = ListHeader->s.Depth + Count;
newHeader.Sequence = ListHeader->Sequence + 1; newHeader.s.Sequence = ListHeader->s.Sequence + 1;
LastEntry->Next = ListHeader->Next.Next; LastEntry->Next = ListHeader->s.Next.Next;
} while (interlocked_cmpxchg64((__int64*)&ListHeader->Alignment, } while (interlocked_cmpxchg64((__int64*)&ListHeader->Alignment,
newHeader.Alignment, newHeader.Alignment,
oldHeader.Alignment) != oldHeader.Alignment); oldHeader.Alignment) != oldHeader.Alignment);
return oldHeader.Next.Next; return oldHeader.s.Next.Next;
#endif #endif
} }

View File

@ -609,7 +609,7 @@ typedef union DECLSPEC_ALIGN(16) _SLIST_HEADER {
struct { struct {
ULONGLONG Alignment; ULONGLONG Alignment;
ULONGLONG Region; ULONGLONG Region;
}; } DUMMYSTRUCTNAME;
struct { struct {
ULONGLONG Depth:16; ULONGLONG Depth:16;
ULONGLONG Sequence:9; ULONGLONG Sequence:9;
@ -642,7 +642,7 @@ typedef union _SLIST_HEADER {
SLIST_ENTRY Next; SLIST_ENTRY Next;
WORD Depth; WORD Depth;
WORD Sequence; WORD Sequence;
}; } DUMMYSTRUCTNAME;
} SLIST_HEADER, *PSLIST_HEADER; } SLIST_HEADER, *PSLIST_HEADER;
#endif #endif