VirtualBox

Changeset 73101 in vbox for trunk/include/iprt


Ignore:
Timestamp:
Jul 12, 2018 9:23:36 PM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
123678
Message:

Added RT_FROM_MEMBER_DYN for use in cases like pic_poll_read.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/cdefs.h

    r73097 r73101  
    23862386#endif
    23872387
     2388/** @def RT_FROM_MEMBER_DYN
     2389 * Convert a pointer to a structure member into a pointer to the structure.
     2390 *
     2391 * @returns pointer to the structure.
     2392 * @param   pMem    Pointer to the member.
     2393 * @param   Type    Structure type.
     2394 * @param   Member  Member name dynamic size (some array is index by
     2395 *                  non-constant value).
     2396 */
     2397#define RT_FROM_MEMBER_DYN(pMem, Type, Member)  ( (Type *) ((uint8_t *)(void *)(pMem) - RT_UOFFSETOF_DYN(Type, Member)) )
     2398
    23882399/** @def RT_ELEMENTS
    23892400 * Calculates the number of elements in a statically sized array.
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette