mirror of https://github.com/mpv-player/mpv
osdep: add portable C11-like alignof() macro
This commit is contained in:
parent
af4fe28af7
commit
707b404820
|
@ -17,5 +17,10 @@
|
||||||
#define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format (gnu_printf, a1, a2)))
|
#define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format (gnu_printf, a1, a2)))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if __STDC_VERSION__ >= 201112L
|
||||||
|
#include <stdalign.h>
|
||||||
|
#else
|
||||||
|
#define alignof(x) (offsetof(struct {char unalign_; x u;}, u))
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue