dix: macro for computing extra units needed for reply header

Add macro X_REPLY_HEADER_UNITS() for computing how many extra
protocol units are needed for a reply header (for .length field)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult
2025-08-14 16:40:42 +02:00
parent a95ae61658
commit 8a2dfa1aba

View File

@@ -739,4 +739,13 @@ static inline Atom dixGetAtomID(const char *name) {
return MakeAtom(name, (unsigned int)strlen(name), FALSE);
}
/* compute the amount of extra units a reply header needs.
*
* all reply header structs are at least the size of xGenericReply
* we have to count how many units the header is bigger than xGenericReply
*
*/
#define X_REPLY_HEADER_UNITS(hdrtype) \
(pad_to_int32((sizeof(hdrtype) - sizeof(xGenericReply))))
#endif /* _XSERVER_DIX_PRIV_H */