VirtualBox

Changeset 106035 in vbox for trunk/include/iprt


Ignore:
Timestamp:
Sep 12, 2024 1:38:42 PM (8 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
164784
Message:

iprt/cdefs.h: Wrapper for some uses of constexpr (only needed in code that isn't explictly c++17 or later). bugref:10720

File:
1 edited

Legend:

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

    r105390 r106035  
    13921392/** @def RT_NOEXCEPT
    13931393 * Wrapper for the C++11 noexcept keyword (only true form).
    1394  * @note use RT_NOTHROW instead.
    13951394 */
    13961395/** @def RT_NOEXCEPT_EX
     
    14631462 * The typical cache line size for the target architecture.
    14641463 * @see RT_ALIGNAS_VAR, RT_ALIGNAS_TYPE, RT_ALIGNAS_MEMB
     1464 * @todo This is not correct for M1,M2,M3,M4,++, they have 128 byte cache lines.
    14651465 */
    14661466#if  defined(RT_ARCH_X86)     || defined(RT_ARCH_AMD64) \
     
    14721472# define RT_CACHELINE_SIZE  128     /* better overdo it */
    14731473#endif
     1474
     1475
     1476/** @def RT_CONSTEXPR
     1477 * Wrapper for the C++11 constexpr keyword for use as per C++11.
     1478 */
     1479#if RT_CPLUSPLUS_PREREQ(201100)
     1480# define RT_CONSTEXPR                   constexpr
     1481#else
     1482# define RT_CONSTEXPR
     1483#endif
     1484
     1485/** @def RT_CONSTEXPR_IF
     1486 * Wrapper for the C++17 use of constexpr in combination with if statements.
     1487 */
     1488#if RT_CPLUSPLUS_PREREQ(201700)
     1489# define RT_CONSTEXPR_IF(a_CondExpr)    constexpr(a_CondExpr)
     1490#else
     1491# define RT_CONSTEXPR_IF(a_CondExpr)    (a_CondExpr)
     1492#endif
     1493
    14741494
    14751495/** @def RT_FALL_THROUGH
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette