mirror of
https://gitlab.freedesktop.org/xorg/lib/libxcb.git
synced 2025-12-20 05:40:11 +01:00
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
1 changed files with 5 additions and 1 deletions
|
|
@ -47,7 +47,11 @@ extern "C" {
|
|||
* @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__))
|
||||
#else
|
||||
#define XCB_PACKED
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue