VirtualBox

Changeset 5104 in vbox


Ignore:
Timestamp:
Sep 28, 2007 5:14:52 PM (17 years ago)
Author:
vboxsync
Message:

RT_UOFFSETOF

File:
1 edited

Legend:

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

    r4852 r5104  
    804804
    805805/** @def RT_OFFSETOF
    806  * Our own special offsetof() variant.
     806 * Our own special offsetof() variant, returns a signed result.
    807807 *
    808808 * This differs from the usual offsetof() in that it's not relying on builtin
     
    811811 * with a variable length field.
    812812 *
    813  * @returns offset into the structure of the specified member.
     813 * @returns offset into the structure of the specified member. signed.
    814814 * @param   type    Structure type.
    815815 * @param   member  Member.
    816816 */
    817817#define RT_OFFSETOF(type, member)   ( (int)(uintptr_t)&( ((type *)(void *)0)->member) )
     818
     819/** @def RT_UOFFSETOF
     820 * Our own special offsetof() variant, returns an unsigned result.
     821 *
     822 * This differs from the usual offsetof() in that it's not relying on builtin
     823 * compiler stuff and thus can use variables in arrays the structure may
     824 * contain. If in this usful to determin the sizes of structures ending
     825 * with a variable length field.
     826 *
     827 * @returns offset into the structure of the specified member. unsigned.
     828 * @param   type    Structure type.
     829 * @param   member  Member.
     830 */
     831#define RT_UOFFSETOF(type, member)   ( (uintptr_t)&( ((type *)(void *)0)->member) )
    818832
    819833/** @def RT_SIZEOFMEMB
Note: See TracChangeset for help on using the changeset viewer.

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