A simple but substantial change: uIP used the htons()/HTONS() macro

functions for converting between host and network byte order. These
names are the de facto standard names for this functionality because
of the original BSD TCP/IP implementation. But they cause problems for
uIP/Contiki: some platforms define these names themselves (Mac OS,
most notably), causing compilation problems for Contiki on those
platforms.

This commit changes all htons to uip_htons instead. Same goes for
htonl, ntohs, and ntohl. All-caps versions as well.
This commit is contained in:
adamdunkels 2010-10-19 18:29:03 +00:00
parent 5a46c629de
commit 5585d72c86
115 changed files with 675 additions and 675 deletions

View file

@ -28,7 +28,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: rime-udp.c,v 1.6 2010/06/14 19:19:17 adamdunkels Exp $
* $Id: rime-udp.c,v 1.7 2010/10/19 18:29:04 adamdunkels Exp $
*/
/**
@ -77,18 +77,18 @@ PROCESS_THREAD(rime_udp_process, ev, data)
PROCESS_BEGIN();
broadcast_conn = udp_broadcast_new(HTONS(RIME_UDP_PORT), NULL);
broadcast_conn = udp_broadcast_new(UIP_HTONS(RIME_UDP_PORT), NULL);
if(broadcast_conn == NULL) {
PRINTF("rime-udp: Failed to allocate a broadcast connection!\n");
}
uip_create_unspecified(&ipaddr);
unicast_conn = udp_new(&ipaddr, HTONS(RIME_UDP_PORT), NULL);
unicast_conn = udp_new(&ipaddr, UIP_HTONS(RIME_UDP_PORT), NULL);
if(unicast_conn == NULL) {
PRINTF("rime-udp: Failed to allocate a unicast connection!\n");
}
udp_bind(unicast_conn, HTONS(RIME_UDP_PORT));
udp_bind(unicast_conn, UIP_HTONS(RIME_UDP_PORT));
while(1) {
PROCESS_WAIT_EVENT_UNTIL(ev == tcpip_event);