samples: sockets: sntp_client: Build for both native Zephyr and POSIX

To make sure sntp API plays well with CONFIG_POSIX_API.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
This commit is contained in:
Paul Sokolovsky 2019-09-05 17:24:32 +03:00 committed by Jukka Rissanen
commit 1858b31536
2 changed files with 13 additions and 3 deletions

View file

@ -1,8 +1,15 @@
sample: sample:
description: SNTP client sample description: SNTP client sample
name: sntp_client name: sntp_client
common:
harness: net
platform_whitelist: qemu_x86
tags: net
tests: tests:
sample.net.sockets.sntp_client: sample.net.sockets.sntp_client:
harness: net extra_configs:
platform_whitelist: qemu_x86 - CONFIG_NET_SOCKETS_POSIX_NAMES=y
tags: net sample.net.sockets.sntp_client.posix:
extra_configs:
- CONFIG_NET_SOCKETS_POSIX_NAMES=n
- CONFIG_POSIX_API=y

View file

@ -9,6 +9,9 @@
LOG_MODULE_REGISTER(net_sntp_client_sample, LOG_LEVEL_DBG); LOG_MODULE_REGISTER(net_sntp_client_sample, LOG_LEVEL_DBG);
#include <net/sntp.h> #include <net/sntp.h>
#ifdef CONFIG_POSIX_API
#include <arpa/inet.h>
#endif
#include "config.h" #include "config.h"