VirtualBox

Changeset 103976 in vbox for trunk/include


Ignore:
Timestamp:
Mar 20, 2024 10:34:35 PM (10 months ago)
Author:
vboxsync
Message:

iprt/cdefs.h: RT_OVERRIDE adj for clang; added RT_FINAL.

File:
1 edited

Legend:

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

    r103755 r103976  
    13451345 */
    13461346#ifdef __cplusplus
    1347 # if RT_MSC_PREREQ_EX(RT_MSC_VER_VS2012, 0)
     1347# if RT_MSC_PREREQ_EX(RT_MSC_VER_VS2012, 0) || RT_CLANG_HAS_FEATURE(cxx_override_control)
    13481348#  define RT_OVERRIDE           override
    1349 # elif RT_GNUC_PREREQ(4, 7)
     1349# elif RT_GNUC_PREREQ(4, 7) || RT_CLANG_PREREQ(7, 1) /** @todo possibly clang supports this earlier. found no __has_feature check. */
    13501350#  if __cplusplus >= 201100
    13511351#   define RT_OVERRIDE          override
     
    13581358#else
    13591359# define RT_OVERRIDE
     1360#endif
     1361
     1362/** @def RT_FINAL
     1363 * Wrapper for the C++11 final keyword.
     1364 *
     1365 * @remarks Recognized by g++ starting 4.7. Assumes it triggers warnings just
     1366 *          like override does when C++11 isn't officially enabled.
     1367 */
     1368#ifdef __cplusplus
     1369# if RT_MSC_PREREQ_EX(RT_MSC_VER_VS2015, 0) /** @todo not sure since when this is supported, probably 2012 like override. */
     1370#  define RT_FINAL              final
     1371# elif RT_GNUC_PREREQ(4, 7) /** @todo clang and final */
     1372#  if __cplusplus >= 201100
     1373#   define RT_FINAL             final
     1374#  else
     1375#   define RT_FINAL
     1376#  endif
     1377# else
     1378#  define RT_FINAL
     1379# endif
     1380#else
     1381# define RT_FINAL
    13601382#endif
    13611383
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