mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
[DEVMGR] Add DYNAMIC_FIELD_OFFSET macro
This replaces the usage of FIELD_OFFSET for dynamic indexing into array fields. Sadly GCC has broken __builtin_offsetof and they don't seem to intend to fix it. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95942
This commit is contained in:
parent
f5e54015ee
commit
bedc16d46d
2 changed files with 5 additions and 3 deletions
|
@ -76,6 +76,8 @@ OUT LPDWORD lpReboot);
|
|||
#include <devmgr/devmgr.h>
|
||||
#include <wine/debug.h>
|
||||
|
||||
#define DYNAMIC_FIELD_OFFSET(Type, Field) ((LONG)(LONG_PTR)&(((Type*) 0)->Field))
|
||||
|
||||
//WINE_DEFAULT_DEBUG_CHANNEL(devmgr);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -1030,8 +1030,8 @@ DeviceCreateHardwarePageEx(IN HWND hWndParent,
|
|||
failure cases! */
|
||||
hpd = (PHARDWARE_PAGE_DATA)HeapAlloc(GetProcessHeap(),
|
||||
HEAP_ZERO_MEMORY,
|
||||
FIELD_OFFSET(HARDWARE_PAGE_DATA,
|
||||
ClassDevInfo[uNumberOfGuids]));
|
||||
DYNAMIC_FIELD_OFFSET(HARDWARE_PAGE_DATA,
|
||||
ClassDevInfo[uNumberOfGuids]));
|
||||
if (hpd != NULL)
|
||||
{
|
||||
HWND hWnd;
|
||||
|
|
Loading…
Reference in a new issue