* include/winnt.h, include/ddk/winddk.h (FIELD_OFFSET):
Compile with recent C++ compiler such as gcc 3.4. * include/ddk/winddk.h: Ditto.
This commit is contained in:
parent
a2601182c0
commit
cb784c8950
|
@ -1,3 +1,9 @@
|
|||
2006-04-19 Dimitri Papadopoulos <papadopo@users.sourceforge.net>
|
||||
|
||||
* include/winnt.h, include/ddk/winddk.h (FIELD_OFFSET):
|
||||
Compile with recent C++ compiler such as gcc 3.4.
|
||||
* include/ddk/winddk.h: Ditto.
|
||||
|
||||
2006-04-19 Dimitri Papadopoulos <papadopo@users.sourceforge.net>
|
||||
|
||||
* include/winuser.h (CharNextEx,CharNextExW,CharPrevEx,CharPrevExW):
|
||||
|
|
|
@ -3967,9 +3967,14 @@ KefReleaseSpinLockFromDpcLevel(
|
|||
* IN PCHAR Field);
|
||||
*/
|
||||
#ifndef FIELD_OFFSET
|
||||
#ifdef __cplusplus
|
||||
#define FIELD_OFFSET(Type, Field) (reinterpret_cast<LONG> \
|
||||
(&reinterpret_cast<char&>(static_cast<Type *>(0)->Field)))
|
||||
#else
|
||||
#define FIELD_OFFSET(Type, Field) \
|
||||
((LONG) (&(((Type *) 0)->Field)))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* PVOID
|
||||
|
|
|
@ -845,7 +845,12 @@ typedef DWORD FLONG;
|
|||
#define RTL_CRITSECT_TYPE 0
|
||||
#define RTL_RESOURCE_TYPE 1
|
||||
/* Also in winddk.h */
|
||||
#ifdef __cplusplus
|
||||
#define FIELD_OFFSET(t,f) (reinterpret_cast<LONG> \
|
||||
(&reinterpret_cast<char&>(static_cast<t*>(0)->f)))
|
||||
#else
|
||||
#define FIELD_OFFSET(t,f) ((LONG)&(((t*)0)->f))
|
||||
#endif
|
||||
#ifndef CONTAINING_RECORD
|
||||
#define CONTAINING_RECORD(address, type, field) \
|
||||
((type*)((PCHAR)(address) - (PCHAR)(&((type *)0)->field)))
|
||||
|
|
Loading…
Reference in New Issue