FreeBSD complation error fixed

There was an error in pgm_receiver wrt strict aliasing.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
This commit is contained in:
Martin Sustrik 2011-03-14 20:29:00 +01:00
parent 2970d6c30b
commit f987f4b3e2

View File

@ -151,7 +151,10 @@ void zmq::pgm_receiver_t::in_event ()
while (true) {
// Get new batch of data.
ssize_t received = pgm_socket.receive ((void**) &data, &tsi);
// Note the workaround made not to break strict-aliasing rules.
void *tmp = NULL;
ssize_t received = pgm_socket.receive (&tmp, &tsi);
data = (unsigned char*) tmp;
// No data to process. This may happen if the packet received is
// neither ODATA nor ODATA.