diff --git a/include/zmq.h b/include/zmq.h index 4754c6ff..d610d195 100644 --- a/include/zmq.h +++ b/include/zmq.h @@ -205,7 +205,10 @@ ZMQ_EXPORT int zmq_ctx_destroy (void *context); /* 0MQ message definition. */ /******************************************************************************/ -typedef struct zmq_msg_t {unsigned char _ [64];} zmq_msg_t; +/* union here ensures correct alignment on architectures that require it, e.g. + * SPARC and ARM + */ +typedef union zmq_msg_t { unsigned char _ [64]; void *p; } zmq_msg_t; typedef void (zmq_free_fn) (void *data, void *hint);