vxWorks htons macro woes

This commit is contained in:
Matej Sekoranja
2014-11-11 12:26:47 +01:00
parent d107074616
commit 2f1c227f4f
3 changed files with 13 additions and 5 deletions

View File

@@ -236,7 +236,9 @@ void ServerSearchHandler::handleResponse(osiSockAddr* responseFrom,
if (responseAddress.ia.sin_addr.s_addr == INADDR_ANY)
responseAddress.ia.sin_addr = responseFrom->ia.sin_addr;
responseAddress.ia.sin_port = htons(payloadBuffer->getShort());
// NOTE: htons might be a macro (e.g. vxWorks)
int16 port = payloadBuffer->getShort();
responseAddress.ia.sin_port = htons(port);
size_t protocolsCount = SerializeHelper::readSize(payloadBuffer, transport.get());
bool allowed = (protocolsCount == 0);