diff --git a/net.c b/net.c index 422ae3bc..5aad409d 100644 --- a/net.c +++ b/net.c @@ -10,7 +10,11 @@ #include #include +#ifdef HAVE_UNISTD_H #include +#elif HAVE_SYS_UNISTD_H +#include +#endif #include #ifdef HAVE_SYS_SOCKET_H #include diff --git a/pdu.c b/pdu.c index 0636a4bf..82854ad7 100644 --- a/pdu.c +++ b/pdu.c @@ -83,7 +83,11 @@ coap_pdu_t * coap_new_pdu() { coap_pdu_t *pdu; +#ifndef WITH_CONTIKI pdu = coap_pdu_init(0, 0, ntohs(COAP_INVALID_TID), COAP_MAX_PDU_SIZE); +#else /* WITH_CONTIKI */ + pdu = coap_pdu_init(0, 0, uip_ntohs(COAP_INVALID_TID), COAP_MAX_PDU_SIZE); +#endif /* WITH_CONTIKI */ #ifndef NDEBUG if (!pdu)