mirror of
https://gitlab.freedesktop.org/xorg/lib/libxcb.git
synced 2026-05-01 21:57:59 +02:00
xcbint.h: use offsetof() from stddef.h instead of defining our own
C89 and later guarantee it will be defined in <stddef.h> and then we don't have to worry about using undefined behavior to define it. Closes: #83 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Part-of: <https://gitlab.freedesktop.org/xorg/lib/libxcb/-/merge_requests/76>
This commit is contained in:
parent
d2153baa99
commit
bfa06609c3
1 changed files with 2 additions and 4 deletions
|
|
@ -34,6 +34,8 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stddef.h> /* for offsetof() definition */
|
||||
|
||||
#ifdef GCC_HAS_VISIBILITY
|
||||
#pragma GCC visibility push(hidden)
|
||||
#endif
|
||||
|
|
@ -65,10 +67,6 @@ enum lazy_reply_tag
|
|||
|
||||
#define XCB_SEQUENCE_COMPARE(a,op,b) ((int64_t) ((a) - (b)) op 0)
|
||||
|
||||
#ifndef offsetof
|
||||
#define offsetof(type,member) ((size_t) &((type *)0)->member)
|
||||
#endif
|
||||
|
||||
#ifndef MIN
|
||||
#define MIN(x,y) ((x) < (y) ? (x) : (y))
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue