VirtualBox

Changeset 85092 in vbox


Ignore:
Timestamp:
Jul 7, 2020 6:22:33 PM (4 years ago)
Author:
vboxsync
Message:

iprt/cdefs.h: Introducing DECL_HIDDEN_NOTHROW for use on functions (couldn't make nothrow fit into the existing DECLHIDDEN as it is applied to data as well as functions). Corrected DECL_FORCE_INLINE to imply nothrow just like DECLINLINE, adding DECL_FORCE_INLINE_THROW in case anyone ever needs it. bugref:9794

File:
1 edited

Legend:

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

    r85086 r85092  
    13741374#endif
    13751375
     1376/** @def DECL_HIDDEN_NOTHROW
     1377 * How to declare a non-exported function that does not throw C++ exceptions.
     1378 * @param   type    The return type of the function or the data type of the variable.
     1379 */
     1380#define DECL_HIDDEN_NOTHROW(a_Type) DECL_NOTHROW(DECLHIDDEN(a_Type))
     1381
    13761382/** @def DECL_INVALID
    13771383 * How to declare a function not available for linking in the current context.
     
    14031409 * @param   type    The return type of the function.
    14041410 */
    1405 #define DECLASMTYPE(type)       DECL_NOTHROW(type RTCALL)
     1411#define DECLASMTYPE(type)       DECL_NOTHROW_TYPEDEF(type RTCALL)
    14061412
    14071413/** @def RT_ASM_DECL_PRAGMA_WATCOM
     
    15831589
    15841590/** @def DECL_FORCE_INLINE
    1585  * How to declare a function as inline and try convince the compiler to always
    1586  * inline it regardless of optimization switches.
     1591 * How to declare a function that does not throw any C++ exceptions as inline
     1592 * and try convince the compiler to always inline it regardless of optimization
     1593 * switches.
    15871594 * @param   type    The return type of the function declaration.
    15881595 * @remarks Use sparsely and with care. Don't use this macro on C++ methods.
     1596 * @sa      DECL_FORCE_INLINE_THROW
    15891597 */
    15901598#ifdef __GNUC__
    15911599# define DECL_FORCE_INLINE(type)    __attribute__((__always_inline__)) DECLINLINE(type)
    15921600#elif defined(_MSC_VER)
    1593 # define DECL_FORCE_INLINE(type)    __forceinline type
     1601# define DECL_FORCE_INLINE(type)    DECL_NOTHROW(__forceinline type)
    15941602#else
    15951603# define DECL_FORCE_INLINE(type)    DECLINLINE(type)
     1604#endif
     1605
     1606/** @def DECL_FORCE_INLINE_THROW
     1607 * How to declare a function throwing C++ exceptions as inline and try convince
     1608 * the compiler to always inline it regardless of optimization switches.
     1609 * @param   type    The return type of the function declaration.
     1610 * @remarks Use sparsely and with care. Don't use this macro on C++ methods.
     1611 */
     1612#ifdef __GNUC__
     1613# define DECL_FORCE_INLINE_THROW(type)  __attribute__((__always_inline__)) DECL_INLINE_THROW(type)
     1614#elif defined(_MSC_VER)
     1615# define DECL_FORCE_INLINE_THROW(type)  __forceinline type
     1616#else
     1617# define DECL_FORCE_INLINE_THROW(type)  DECL_INLINE_THROW(type)
    15961618#endif
    15971619
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