VirtualBox

Changeset 90444 in vbox for trunk


Ignore:
Timestamp:
Jul 30, 2021 10:16:10 PM (3 years ago)
Author:
vboxsync
Message:

iprt/cdefs.h: Added DECL_CHECK_RETURN and DECL_CHECK_RETURN_NOT_R3. bugref:6695

File:
1 edited

Legend:

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

    r90168 r90444  
    11281128 * @note    This macro can be combined with other macros, for example
    11291129 * @code
    1130  *   EMR3DECL(DECL_NOTHROW(void)) foo(void);
     1130 *   RTR3DECL(DECL_NOTHROW(void)) foo(void);
    11311131 * @endcode
    11321132 *
     
    14981498 * @note This macro can be combined with other macros, for example
    14991499 * @code
    1500  *   EMR3DECL(DECL_NO_RETURN(void)) foo(void);
     1500 *   RTR3DECL(DECL_NO_RETURN(void)) foo(void);
    15011501 * @endcode
    15021502 */
     
    15131513 * @note This macro can be combined with other macros, for example
    15141514 * @code
    1515  *   EMR3DECL(DECL_RETURNS_TWICE(void)) MySetJmp(void);
     1515 *   RTR3DECL(DECL_RETURNS_TWICE(void)) MySetJmp(void);
    15161516 * @endcode
    15171517 */
    15181518#if RT_GNUC_PREREQ(4, 1)
    15191519# define DECL_RETURNS_TWICE(a_RetType)  __attribute__((returns_twice)) a_RetType
    1520 # else
     1520#else
    15211521# define DECL_RETURNS_TWICE(a_RetType)  a_RetType
     1522#endif
     1523
     1524/** @def DECL_CHECK_RETURN
     1525 * Require a return value to be checked.
     1526 * @note This macro can be combined with other macros, for example
     1527 * @code
     1528 *   RTR3DECL(DECL_CHECK_RETURN(int)) MayReturnInfoStatus(void);
     1529 * @endcode
     1530 * @todo Visual C++: check _Check_return_ from SAL.
     1531 */
     1532#if RT_GNUC_PREREQ(3, 4)
     1533# define DECL_CHECK_RETURN(a_RetType)  __attribute__((warn_unused_result)) a_RetType
     1534#else
     1535# define DECL_CHECK_RETURN(a_RetType)  a_RetType
     1536#endif
     1537
     1538/** @def DECL_CHECK_RETURN_NOT_R3
     1539 * Variation of DECL_CHECK_RETURN that only applies the required to non-ring-3
     1540 * code.
     1541 */
     1542#ifndef IN_RING3
     1543# define DECL_CHECK_RETURN_NOT_R3(a_RetType)  DECL_CHECK_RETURN(a_RetType)
     1544#else
     1545# define DECL_CHECK_RETURN_NOT_R3(a_RetType)  a_RetType
    15221546#endif
    15231547
     
    15271551 * @note This macro can be combined with other macros, for example
    15281552 * @code
    1529  *   EMR3DECL(DECLWEAK(int)) foo;
     1553 *   RTR3DECL(DECLWEAK(int)) foo;
    15301554 * @endcode
    15311555 */
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