mirror of
https://github.com/reactos/reactos.git
synced 2025-01-13 01:22:03 +00:00
Fix warnings that are issued by new GCC versions.
svn path=/trunk/; revision=41138
This commit is contained in:
parent
718fea97dd
commit
db320e7765
3 changed files with 12 additions and 0 deletions
|
@ -156,8 +156,12 @@ typedef unsigned long POINTER_64; // FIXME! HACK!!!
|
||||||
// Returns the byte offset of the specified structure's member
|
// Returns the byte offset of the specified structure's member
|
||||||
//
|
//
|
||||||
#ifndef FIELD_OFFSET
|
#ifndef FIELD_OFFSET
|
||||||
|
#ifndef __GNUC__
|
||||||
#define FIELD_OFFSET(Type, Field) \
|
#define FIELD_OFFSET(Type, Field) \
|
||||||
((LONG)(LONG_PTR) (&(((Type *) 0)->Field)))
|
((LONG)(LONG_PTR) (&(((Type *) 0)->Field)))
|
||||||
|
#else
|
||||||
|
#define FIELD_OFFSET(Type, Field) __builtin_offsetof(Type, Field)
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -218,7 +218,11 @@ typedef const UNICODE_STRING *PCUNICODE_STRING;
|
||||||
#define MAKELONG(a,b) ((LONG)(((WORD)(a))|(((DWORD)((WORD)(b)))<<16)))
|
#define MAKELONG(a,b) ((LONG)(((WORD)(a))|(((DWORD)((WORD)(b)))<<16)))
|
||||||
|
|
||||||
#define NT_SUCCESS(x) ((x)>=0)
|
#define NT_SUCCESS(x) ((x)>=0)
|
||||||
|
#if !defined(__GNUC__)
|
||||||
#define FIELD_OFFSET(t,f) ((LONG_PTR)&(((t*)0)->f))
|
#define FIELD_OFFSET(t,f) ((LONG_PTR)&(((t*)0)->f))
|
||||||
|
#else
|
||||||
|
#define FIELD_OFFSET(t,f) __builtin_offsetof(t,f)
|
||||||
|
#endif
|
||||||
#define RTL_CONSTANT_STRING(s) { sizeof(s)-sizeof((s)[0]), sizeof(s), s }
|
#define RTL_CONSTANT_STRING(s) { sizeof(s)-sizeof((s)[0]), sizeof(s), s }
|
||||||
#define CONTAINING_RECORD(address, type, field) ((type *)(((ULONG_PTR)address) - (ULONG_PTR)(&(((type *)0)->field))))
|
#define CONTAINING_RECORD(address, type, field) ((type *)(((ULONG_PTR)address) - (ULONG_PTR)(&(((type *)0)->field))))
|
||||||
|
|
||||||
|
|
|
@ -1280,7 +1280,11 @@ typedef enum {
|
||||||
#define RTL_CRITSECT_TYPE 0
|
#define RTL_CRITSECT_TYPE 0
|
||||||
#define RTL_RESOURCE_TYPE 1
|
#define RTL_RESOURCE_TYPE 1
|
||||||
/* Also in winddk.h */
|
/* Also in winddk.h */
|
||||||
|
#ifndef __GNUC__
|
||||||
#define FIELD_OFFSET(t,f) ((LONG_PTR)&(((t*)0)->f))
|
#define FIELD_OFFSET(t,f) ((LONG_PTR)&(((t*)0)->f))
|
||||||
|
#else
|
||||||
|
#define FIELD_OFFSET(t,f) __builtin_offsetof(t,f)
|
||||||
|
#endif
|
||||||
#ifndef CONTAINING_RECORD
|
#ifndef CONTAINING_RECORD
|
||||||
#define CONTAINING_RECORD(address, type, field) \
|
#define CONTAINING_RECORD(address, type, field) \
|
||||||
((type *)(((ULONG_PTR)address) - (ULONG_PTR)(&(((type *)0)->field))))
|
((type *)(((ULONG_PTR)address) - (ULONG_PTR)(&(((type *)0)->field))))
|
||||||
|
|
Loading…
Reference in a new issue