mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-12 12:14:36 +03:00
Refactor __attribute__ usage
Use internal macros for compatibility with non GNUC compilers.
This commit is contained in:

committed by
cgzones

parent
f4602f7b4e
commit
7107d1db0b
16
Macros.h
16
Macros.h
@ -13,4 +13,20 @@
|
||||
#define CLAMP(x, low, high) (((x) > (high)) ? (high) : MAXIMUM(x, low))
|
||||
#endif
|
||||
|
||||
#ifdef __GNUC__ // defined by GCC and Clang
|
||||
|
||||
#define ATTR_FORMAT(type, index, check) __attribute__((format (type, index, check)))
|
||||
#define ATTR_NONNULL __attribute__((nonnull))
|
||||
#define ATTR_NORETURN __attribute__((noreturn))
|
||||
#define ATTR_UNUSED __attribute__((unused))
|
||||
|
||||
#else /* __GNUC__ */
|
||||
|
||||
#define ATTR_FORMAT(type, index, check)
|
||||
#define ATTR_NONNULL
|
||||
#define ATTR_NORETURN
|
||||
#define ATTR_UNUSED
|
||||
|
||||
#endif /* __GNUC__ */
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user