Introduce ALIGNOF macro
* gcc_compat.h (ALIGNOF): New macro.
This commit is contained in:
parent
fdd97aac53
commit
98b944bb66
@ -80,6 +80,12 @@
|
|||||||
# define ATTRIBUTE_SENTINEL /* empty */
|
# define ATTRIBUTE_SENTINEL /* empty */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if GNUC_PREREQ(4, 1)
|
||||||
|
# define ALIGNOF(t_) __alignof__(t_)
|
||||||
|
#else
|
||||||
|
# define ALIGNOF(t_) (sizeof(struct {char x_; t_ y_;}) - sizeof(t_))
|
||||||
|
#endif
|
||||||
|
|
||||||
#if GNUC_PREREQ(4, 3)
|
#if GNUC_PREREQ(4, 3)
|
||||||
# define ATTRIBUTE_ALLOC_SIZE(args) __attribute__((__alloc_size__ args))
|
# define ATTRIBUTE_ALLOC_SIZE(args) __attribute__((__alloc_size__ args))
|
||||||
#else
|
#else
|
||||||
|
Loading…
Reference in New Issue
Block a user