summaryrefslogtreecommitdiff
path: root/include/X11/ICE/ICEmsg.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/X11/ICE/ICEmsg.h')
-rw-r--r--include/X11/ICE/ICEmsg.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/X11/ICE/ICEmsg.h b/include/X11/ICE/ICEmsg.h
index 426b64c..b6bad13 100644
--- a/include/X11/ICE/ICEmsg.h
+++ b/include/X11/ICE/ICEmsg.h
@@ -128,6 +128,7 @@ extern IcePaAuthStatus _IcePaMagicCookie1Proc (
*/
#define IceGetHeader(_iceConn, _major, _minor, _headerSize, _msgType, _pMsg) \
+do { \
static_assert(_headerSize <= 1024, \
"Header size larger than ICE_OUTBUFSIZE"); \
if ((_iceConn->outbufptr + _headerSize) > _iceConn->outbufmax) \
@@ -137,9 +138,11 @@ extern IcePaAuthStatus _IcePaMagicCookie1Proc (
_pMsg->minorOpcode = _minor; \
_pMsg->length = (_headerSize - SIZEOF (iceMsg)) >> 3; \
_iceConn->outbufptr += _headerSize; \
- _iceConn->send_sequence++
+ _iceConn->send_sequence++; \
+} while (0)
#define IceGetHeaderExtra(_iceConn, _major, _minor, _headerSize, _extra, _msgType, _pMsg, _pData) \
+do { \
static_assert(_headerSize <= 1024, \
"Header size larger than ICE_OUTBUFSIZE"); \
if ((_iceConn->outbufptr + \
@@ -156,7 +159,8 @@ extern IcePaAuthStatus _IcePaMagicCookie1Proc (
_pMsg->majorOpcode = _major; \
_pMsg->minorOpcode = _minor; \
_pMsg->length = ((_headerSize - SIZEOF (iceMsg)) >> 3) + (_extra); \
- _iceConn->send_sequence++
+ _iceConn->send_sequence++; \
+} while (0)
#define IceSimpleMessage(_iceConn, _major, _minor) \
{ \