Changeset 5104 in vbox
- Timestamp:
- Sep 28, 2007 5:14:52 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/cdefs.h
r4852 r5104 804 804 805 805 /** @def RT_OFFSETOF 806 * Our own special offsetof() variant .806 * Our own special offsetof() variant, returns a signed result. 807 807 * 808 808 * This differs from the usual offsetof() in that it's not relying on builtin … … 811 811 * with a variable length field. 812 812 * 813 * @returns offset into the structure of the specified member. 813 * @returns offset into the structure of the specified member. signed. 814 814 * @param type Structure type. 815 815 * @param member Member. 816 816 */ 817 817 #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) ) 818 832 819 833 /** @def RT_SIZEOFMEMB
Note:
See TracChangeset
for help on using the changeset viewer.