VirtualBox

Changeset 60023 in vbox


Ignore:
Timestamp:
Mar 14, 2016 6:40:57 PM (9 years ago)
Author:
vboxsync
Message:

iprt/cdefs.h,setjmp.h: Added DECL_RETURNS_TWICE and renamed DECLNORETURN to DECL_NO_RETURN.

Location:
trunk/include/iprt
Files:
2 edited

Legend:

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

    r60007 r60023  
    11231123#define DECLASMTYPE(type)       type RTCALL
    11241124
    1125 /** @def DECLNORETURN
     1125/** @def DECL_NO_RETURN
    11261126 * How to declare a function which does not return.
    1127  * @note: This macro can be combined with other macros, for example
     1127 * @note This macro can be combined with other macros, for example
    11281128 * @code
    1129  *   EMR3DECL(DECLNORETURN(void)) foo(void);
     1129 *   EMR3DECL(DECL_NO_RETURN(void)) foo(void);
    11301130 * @endcode
    11311131 */
    11321132#ifdef _MSC_VER
    1133 # define DECLNORETURN(type)     __declspec(noreturn) type
     1133# define DECL_NO_RETURN(type)   __declspec(noreturn) type
    11341134#elif defined(__GNUC__)
    1135 # define DECLNORETURN(type)     __attribute__((noreturn)) type
    1136 #else
    1137 # define DECLNORETURN(type)     type
     1135# define DECL_NO_RETURN(type)   __attribute__((noreturn)) type
     1136#else
     1137# define DECL_NO_RETURN(type)   type
     1138#endif
     1139/** @deprecated Use DECL_NO_RETURN instead. */
     1140#define DECLNORETURN(type) DECL_NO_RETURN(type)
     1141
     1142/** @def DECL_RETURNS_TWICE
     1143 * How to declare a function which may return more than once.
     1144 * @note This macro can be combined with other macros, for example
     1145 * @code
     1146 *   EMR3DECL(DECL_RETURNS_TWICE(void)) MySetJmp(void);
     1147 * @endcode
     1148 */
     1149#ifdef __GNUC__
     1150# if (__GNUC__ >= 5) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)
     1151#  define DECL_RETURNS_TWICE(type)  __attribute__((returns_twice)) type
     1152# else
     1153#  define DECL_RETURNS_TWICE(type)  type
     1154# endif
     1155#else
     1156# define DECL_RETURNS_TWICE(type)   type
    11381157#endif
    11391158
     
    11411160 * How to declare a variable which is not necessarily resolved at
    11421161 * runtime.
    1143  * @note: This macro can be combined with other macros, for example
     1162 * @note This macro can be combined with other macros, for example
    11441163 * @code
    11451164 *   EMR3DECL(DECLWEAK(int)) foo;
  • trunk/include/iprt/nocrt/setjmp.h

    r56291 r60023  
    4141#endif
    4242
    43 extern int RT_NOCRT(setjmp)(RT_NOCRT(jmp_buf));
    44 extern int RT_NOCRT(longjmp)(RT_NOCRT(jmp_buf), int);
     43extern DECL_RETURNS_TWICE(int) RT_NOCRT(setjmp)(RT_NOCRT(jmp_buf));
     44extern DECL_NO_RETURN(int)    RT_NOCRT(longjmp)(RT_NOCRT(jmp_buf), int);
    4545
    4646#if !defined(RT_WITHOUT_NOCRT_WRAPPERS) && !defined(RT_WITHOUT_NOCRT_WRAPPER_ALIASES)
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