mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-12 12:14:36 +03:00
Check for alloc_size attribute in configure.ac
This commit is contained in:
16
Macros.h
16
Macros.h
@ -37,8 +37,6 @@
|
||||
#define ATTR_NONNULL __attribute__((nonnull))
|
||||
#define ATTR_NORETURN __attribute__((noreturn))
|
||||
#define ATTR_UNUSED __attribute__((unused))
|
||||
#define ATTR_ALLOC_SIZE1(a) __attribute__((alloc_size (a)))
|
||||
#define ATTR_ALLOC_SIZE2(a, b) __attribute__((alloc_size (a, b)))
|
||||
#define ATTR_MALLOC __attribute__((malloc))
|
||||
|
||||
#else /* __GNUC__ */
|
||||
@ -47,12 +45,22 @@
|
||||
#define ATTR_NONNULL
|
||||
#define ATTR_NORETURN
|
||||
#define ATTR_UNUSED
|
||||
#define ATTR_ALLOC_SIZE1(a)
|
||||
#define ATTR_ALLOC_SIZE2(a, b)
|
||||
#define ATTR_MALLOC
|
||||
|
||||
#endif /* __GNUC__ */
|
||||
|
||||
#ifdef HAVE_ATTR_ALLOC_SIZE
|
||||
|
||||
#define ATTR_ALLOC_SIZE1(a) __attribute__((alloc_size (a)))
|
||||
#define ATTR_ALLOC_SIZE2(a, b) __attribute__((alloc_size (a, b)))
|
||||
|
||||
#else
|
||||
|
||||
#define ATTR_ALLOC_SIZE1(a)
|
||||
#define ATTR_ALLOC_SIZE2(a, b)
|
||||
|
||||
#endif /* HAVE_ATTR_ALLOC_SIZE */
|
||||
|
||||
// ignore casts discarding const specifier, e.g.
|
||||
// const char [] -> char * / void *
|
||||
// const char *[2]' -> char *const *
|
||||
|
Reference in New Issue
Block a user