diff options
author | Martin Sustrik <sustrik@250bpm.com> | 2011-07-08 18:12:59 +0200 |
---|---|---|
committer | Martin Sustrik <sustrik@250bpm.com> | 2011-07-08 18:12:59 +0200 |
commit | aa2150c25c9b0dd518b058f0c50420417441fd23 (patch) | |
tree | 549d75aef00f6f3977224c1cecd3c02f74aaf349 /src/msg.cpp | |
parent | 1526ff638c9cb37b156fd80a40889ac3d8258343 (diff) |
VSM data are aligned to 32/64 bit boundary
Till now the VSM buffer was aligned to 16 bit boundary
which could possibly cause problems on RISC architectures
when accessing the message data in unsafe manner.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Diffstat (limited to 'src/msg.cpp')
-rw-r--r-- | src/msg.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/msg.cpp b/src/msg.cpp index 84ca3e2..fcc04ab 100644 --- a/src/msg.cpp +++ b/src/msg.cpp @@ -19,6 +19,7 @@ */ #include "msg.hpp" +#include "../include/zmq.h" #include <string.h> #include <errno.h> @@ -29,6 +30,11 @@ #include "likely.hpp" #include "err.hpp" +// Check whether the sizes of public representation of the message (zmq_msg_t) +// and private represenation of the message (zmq::msg_t) match. +typedef char zmq_msg_size_check + [2 * ((sizeof (zmq::msg_t) == sizeof (zmq_msg_t)) != 0) - 1]; + bool zmq::msg_t::check () { return u.base.type >= type_min && u.base.type <= type_max; |