This patch activates the build of debug.c on android and also fixes one
build issue with this code in android.
in_port_t is not defined in <netinet/in.h> in the android NDK, use
"unsigned short int" instead because this is also used by sin_port in
the Android NDK.
There is already a bug for Android open to fix this problem in Android
here: https://code.google.com/p/android/issues/detail?id=80713
With this change the tinydtls debug.c file compiles for me for Android.
Change-Id: Id03a319768357ea1bef3f86ac2342e61e2b26b79
Signed-off-by: Hauke Mehrtens <hauke.mehrtens@lantiq.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/3195
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Sachin Agrawal <sachin.agrawal@intel.com>
env.AppendUnique(TINYDTLS_SRC = tinydtls_src)
if not env.get('RELEASE'):
- if(target_os) not in ['android', 'arduino']:
+ if(target_os) not in ['arduino']:
env.AppendUnique(TINYDTLS_SRC = ['debug.c'])
else:
env.AppendUnique(CPPDEFINES = ['NDEBUG'])
dsrv_print_addr(const session_t *addr, char *buf, size_t len) {
#ifdef HAVE_ARPA_INET_H
const void *addrptr = NULL;
+#ifdef __ANDROID__
+ unsigned short int port;
+#else
in_port_t port;
+#endif
char *p = buf;
switch (addr->addr.sa.sa_family) {