Changeset 66098 in vbox
- Timestamp:
- Mar 14, 2017 7:04:01 PM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 113977
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/cdefs.h
r66089 r66098 2289 2289 * 2290 2290 * @note Use RT_UOFFSETOF() to calculate the structure size. 2291 * 2291 2292 * @note Never to a sizeof() on the structure or member! 2293 * 2292 2294 * @note The member must be the last one. 2293 * @note GCC does not permit using this in a union. 2295 * 2296 * @note GCC does not permit using this in a union. So, for unions you must 2297 * use RT_FLEXIBLE_ARRAY_IN_UNION instead. 2298 * 2294 2299 * @note GCC does not permit using this in nested structures, where as MSC 2295 2300 * does. So, use RT_FLEXIBLE_ARRAY_NESTED for that. 2296 2301 * 2297 * @sa RT_FLEXIBLE_ARRAY_NESTED 2298 */ 2299 #if RT_MSC_PREREQ(RT_MSC_VER_VS20 10) /** @todo Probably much much earlier. */ \2302 * @sa RT_FLEXIBLE_ARRAY_NESTED, RT_FLEXIBLE_ARRAY_IN_UNION 2303 */ 2304 #if RT_MSC_PREREQ(RT_MSC_VER_VS2005) /** @todo Probably much much earlier. */ \ 2300 2305 || (defined(__cplusplus) && RT_GNUC_PREREQ(6, 1)) \ 2301 2306 || defined(__WATCOMC__) /* openwatcom 1.9 supports it, we don't care about older atm. */ … … 2312 2317 #else 2313 2318 # define RT_FLEXIBLE_ARRAY 1 2319 #endif 2320 2321 /** @def RT_FLEXIBLE_ARRAY_NESTED 2322 * Variant of RT_FLEXIBLE_ARRAY for use in structures that are nested. 2323 * 2324 * GCC only allow the use of flexible array member in the top structure, whereas 2325 * MSC is less strict and let you do struct { struct { char szName[]; } s; }; 2326 * 2327 * @note See notes for RT_FLEXIBLE_ARRAY. 2328 * 2329 * @note GCC does not permit using this in a union. So, for unions you must 2330 * use RT_FLEXIBLE_ARRAY_IN_NESTED_UNION instead. 2331 * 2332 * @sa RT_FLEXIBLE_ARRAY, RT_FLEXIBLE_ARRAY_IN_NESTED_UNION 2333 */ 2334 #ifdef _MSC_VER 2335 # define RT_FLEXIBLE_ARRAY_NESTED RT_FLEXIBLE_ARRAY 2336 #else 2337 # define RT_FLEXIBLE_ARRAY_NESTED 1 2338 #endif 2339 2340 /** @def RT_FLEXIBLE_ARRAY_IN_UNION 2341 * The union version of RT_FLEXIBLE_ARRAY. 2342 * 2343 * @remarks GCC does not support flexible array members in unions, 6.1.x 2344 * actively checks for this. Visual C++ 2010 seems happy with it. 2345 * 2346 * @note See notes for RT_FLEXIBLE_ARRAY. 2347 * 2348 * @sa RT_FLEXIBLE_ARRAY, RT_FLEXIBLE_ARRAY_IN_NESTED_UNION 2349 */ 2350 #ifdef _MSC_VER 2351 # define RT_FLEXIBLE_ARRAY_IN_UNION RT_FLEXIBLE_ARRAY 2352 #else 2353 # define RT_FLEXIBLE_ARRAY_IN_UNION 1 2354 #endif 2355 2356 /** @def RT_FLEXIBLE_ARRAY_IN_NESTED_UNION 2357 * The union version of RT_FLEXIBLE_ARRAY_NESTED. 2358 * 2359 * @note See notes for RT_FLEXIBLE_ARRAY. 2360 * 2361 * @sa RT_FLEXIBLE_ARRAY, RT_FLEXIBLE_ARRAY_IN_NESTED_UNION 2362 */ 2363 #ifdef _MSC_VER 2364 # define RT_FLEXIBLE_ARRAY_IN_NESTED_UNION RT_FLEXIBLE_ARRAY_NESTED 2365 #else 2366 # define RT_FLEXIBLE_ARRAY_IN_NESTED_UNION 1 2314 2367 #endif 2315 2368
Note:
See TracChangeset
for help on using the changeset viewer.