xcb.h: use __has_attribute to check for attribute((__packed__)) support
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Part-of: <https://gitlab.freedesktop.org/xorg/lib/libxcb/-/merge_requests/64>
This commit is contained in:
parent
124690ba63
commit
021e887de9
|
@ -47,7 +47,11 @@ extern "C" {
|
||||||
* @file xcb.h
|
* @file xcb.h
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#ifndef __has_attribute
|
||||||
|
# define __has_attribute(x) 0 /* Compatibility with older compilers. */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(__GNUC__) || __has_attribute(__packed__)
|
||||||
#define XCB_PACKED __attribute__((__packed__))
|
#define XCB_PACKED __attribute__((__packed__))
|
||||||
#else
|
#else
|
||||||
#define XCB_PACKED
|
#define XCB_PACKED
|
||||||
|
|
Loading…
Reference in New Issue