mirror of
https://github.com/RTimothyEdwards/magic.git
synced 2026-10-06 09:53:00 +02:00
utils/magic.h: ATTR_UNREACHABLE ATTR_NORETURN
Add optional compiler support for these attribute hints.
This commit is contained in:
@@ -173,10 +173,14 @@ extern char AbortMessage[];
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
#define ATTR_FORMAT_PRINTF_1 __attribute__((format (printf,1,2)))
|
||||
#define ATTR_FORMAT_PRINTF_2 __attribute__((format (printf,2,3)))
|
||||
#define ATTR_UNREACHABLE __builtin_unreachable()
|
||||
#define ATTR_NORETURN __attribute__((noreturn))
|
||||
#define __unused__(x) x __attribute__((unused))
|
||||
#else
|
||||
#define ATTR_FORMAT_PRINTF_1 /* */
|
||||
#define ATTR_FORMAT_PRINTF_2 /* */
|
||||
#define ATTR_UNREACHABLE /* */
|
||||
#define ATTR_NORETURN /* */
|
||||
#define __unused__(x) x
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user