mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-12-25 10:54:52 +01:00
Provide a NORETURN_ATTRIBUTE macro similar to PRINTF_ATTRIBUTE
This attribute is understood by gcc since version 2.5. clang provides support for testing for function attributes using __has_attribute. For other compilers this macro evaluates to the empty string. Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
This commit is contained in:
parent
da12807734
commit
25d97b9791
1 changed files with 16 additions and 0 deletions
|
@ -28,4 +28,20 @@
|
|||
#define __has_attribute(x) 0
|
||||
#endif
|
||||
|
||||
/* Provide a NORETURN_ATTRIBUTE macro similar to PRINTF_ATTRIBUTE from
|
||||
* talloc.
|
||||
*
|
||||
* This attribute is understood by gcc since version 2.5. clang
|
||||
* provides support for testing for function attributes.
|
||||
*/
|
||||
#ifndef NORETURN_ATTRIBUTE
|
||||
#if (__GNUC__ >= 3 || \
|
||||
(__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || \
|
||||
__has_attribute (noreturn))
|
||||
#define NORETURN_ATTRIBUTE __attribute__ ((noreturn))
|
||||
#else
|
||||
#define NORETURN_ATTRIBUTE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue