[IOT-2539] clean implicit-function-declaration 89/22189/2
authorGeorge Nash <george.nash@intel.com>
Mon, 31 Jul 2017 16:55:14 +0000 (09:55 -0700)
committerRick Bell <richard.s.bell@intel.com>
Mon, 18 Sep 2017 17:39:58 +0000 (17:39 +0000)
The pdu.c file was producing an implicit-function-declaration
warning for the ntohs() function. The ntohs function is part
of the arpa/inet.h header.  This is conditionally included
based on the HAVE_ARPA_INET_H macro. The HAVE_ARPA_INET_H
macro is defined in the iotivity_config.h header. So
iotivity_config.h must be included in pdu.c to properly detect
the macro.

It looks like some systems may supply the ntohs() function
without arpa/inet.h. So it is unclear if the call to the
function its self needs some added macros.

Change-Id: I7e19d65e1371d46b35d70a5ecdf06fb0b73152ff
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21683
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
(cherry picked from commit 9b704e02253b181f88c00aad98083bfeb55328ae)

resource/csdk/connectivity/lib/libcoap-4.1.1/pdu.c

index d2ca93e..4079fb8 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #include "include/coap/config.h"
-
+#include "iotivity_config.h"
 #if defined(HAVE_ASSERT_H) && !defined(assert)
 # include <assert.h>
 #endif