VirtualBox

Changeset 66079 in vbox


Ignore:
Timestamp:
Mar 14, 2017 10:40:41 AM (8 years ago)
Author:
vboxsync
Message:

iprt/cdefs.h: Added RT_FLEXIBLE_ARRAY_NESTED to deal with MSC/GCC difference.

File:
1 edited

Legend:

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

    r66064 r66079  
    22912291 * @note    Never to a sizeof() on the structure or member!
    22922292 * @note    The member must be the last one.
     2293 * @note    GCC does not permit using this in nested structures, where as MSC
     2294 *          does.  So, use RT_FLEXIBLE_ARRAY_NESTED for that.
     2295 *
     2296 * @sa      RT_FLEXIBLE_ARRAY_NESTED
    22932297 */
    22942298#if RT_MSC_PREREQ(RT_MSC_VER_VS2010) /** @todo Probably much much earlier. */ \
     
    23072311#else
    23082312# define RT_FLEXIBLE_ARRAY                      1
     2313#endif
     2314
     2315/** @def RT_FLEXIBLE_ARRAY_NESTED
     2316 * Variant of RT_FLEXIBLE_ARRAY for use in structures that are nested.
     2317 *
     2318 * GCC only allow the use of flexible array member in the top structure, whereas
     2319 * MSC is less strict and let you do struct { struct { char szName[]; } s; };
     2320 * @sa      RT_FLEXIBLE_ARRAY
     2321 */
     2322#ifdef _MSC_VER
     2323# define RT_FLEXIBLE_ARRAY_NESTED               RT_FLEXIBLE_ARRAY
     2324#else
     2325# define RT_FLEXIBLE_ARRAY_NESTED               1
    23092326#endif
    23102327
Note: See TracChangeset for help on using the changeset viewer.

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