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:
parent
a7bb2850f7
commit
1858b31536
2 changed files with 13 additions and 3 deletions
|
@ -1,8 +1,15 @@
|
|||
sample:
|
||||
description: SNTP client sample
|
||||
name: sntp_client
|
||||
tests:
|
||||
sample.net.sockets.sntp_client:
|
||||
common:
|
||||
harness: net
|
||||
platform_whitelist: qemu_x86
|
||||
tags: net
|
||||
tests:
|
||||
sample.net.sockets.sntp_client:
|
||||
extra_configs:
|
||||
- CONFIG_NET_SOCKETS_POSIX_NAMES=y
|
||||
sample.net.sockets.sntp_client.posix:
|
||||
extra_configs:
|
||||
- CONFIG_NET_SOCKETS_POSIX_NAMES=n
|
||||
- CONFIG_POSIX_API=y
|
||||
|
|
|
@ -9,6 +9,9 @@
|
|||
LOG_MODULE_REGISTER(net_sntp_client_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <net/sntp.h>
|
||||
#ifdef CONFIG_POSIX_API
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
|
||||
#include "config.h"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue