mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 08:04:30 +00:00
dix: macro for checking X protocol types
The X protocol types from xorgproto all have corresponding sz_<typename> defines with their actual network payload size (this can be checked via SIZEOF() macro). In theory, this should always be the same as sizeof(), but just to be sure, adding a macro for a static assert on that. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
@@ -38,6 +38,13 @@
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/* static assert for protocol structure sizes */
|
||||
#ifndef __size_assert
|
||||
#define __size_assert(what, howmuch) \
|
||||
typedef char what##_size_wrong_[( !!(sizeof(what) == howmuch) )*2-1 ]
|
||||
#endif
|
||||
#define XTYPE_SIZE_ASSERT(typename) __size_assert(typename,SIZEOF(typename))
|
||||
|
||||
/* server setting: maximum size for big requests */
|
||||
#define MAX_BIG_REQUEST_SIZE 4194303
|
||||
extern long maxBigRequestSize;
|
||||
|
||||
Reference in New Issue
Block a user