Commit c794ff88 authored by Ghislain MARY's avatar Ghislain MARY

Define MIN as a macro for Visual Studio to compile sucessfully.

parent 29deaf23
......@@ -196,9 +196,8 @@ bzrtpPacket_t *bzrtp_packetCheck(const uint8_t * input, uint16_t inputLength, ui
}
static uint8_t min(const uint8_t a, const uint8_t b) {
return a < b ? a : b;
}
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
/* Call this function after the packetCheck one, to actually parse the packet : create and fill the messageData structure */
int bzrtp_packetParser(bzrtpContext_t *zrtpContext, bzrtpChannelContext_t *zrtpChannelContext, const uint8_t * input, uint16_t inputLength, bzrtpPacket_t *zrtpPacket) {
......@@ -229,13 +228,13 @@ int bzrtp_packetParser(bzrtpContext_t *zrtpContext, bzrtpChannelContext_t *zrtpC
messageData->M = ((*messageContent)>>5)&0x01;
messageData->P = ((*messageContent)>>4)&0x01;
messageContent +=1;
messageData->hc = min((*messageContent)&0x0F, 7);
messageData->hc = MIN((*messageContent)&0x0F, 7);
messageContent +=1;
messageData->cc = min(((*messageContent)>>4)&0x0F, 7);
messageData->ac = min((*messageContent)&0x0F, 7);
messageData->cc = MIN(((*messageContent)>>4)&0x0F, 7);
messageData->ac = MIN((*messageContent)&0x0F, 7);
messageContent +=1;
messageData->kc = min(((*messageContent)>>4)&0x0F, 7);
messageData->sc = min((*messageContent)&0x0F, 7);
messageData->kc = MIN(((*messageContent)>>4)&0x0F, 7);
messageData->sc = MIN((*messageContent)&0x0F, 7);
messageContent +=1;
/* Check message length according to value in hc, cc, ac, kc and sc */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment