VirtualBox

Changeset 1448 in vbox


Ignore:
Timestamp:
Mar 13, 2007 4:12:21 PM (18 years ago)
Author:
vboxsync
Message:

AssertCompileMemberAlignment didn't work in C++ code on with gcc 4.1.1 (amd64 only it seems). Use the builtin offsetof function there instead. (Hope this doesn't cause trouble...)

File:
1 edited

Legend:

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

    r658 r1448  
    776776 * @param   member  Member.
    777777 */
    778 #define RT_OFFSETOF(type, member)      ( (int)(uintptr_t)&( ((type *)(void *)0)->member) )
     778#if defined(__GNUC__) && defined(__cplusplus)
     779# define RT_OFFSETOF(type, member)      ( (int)__builtin_offsetof(type, member) )
     780#else
     781# define RT_OFFSETOF(type, member)      ( (int)(uintptr_t)&( ((type *)(void *)0)->member) )
     782#endif
    779783
    780784/** @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