mirror of
https://github.com/reactos/reactos.git
synced 2026-06-06 13:47:40 +08: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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user