ztest: define _POSIX_C_SOURCE macro
Add declaration of the _POSIX_C_SOURCE < 200809L for ztest library for declaration of strtok_r and strdup functions. Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
This commit is contained in:
parent
4045975c80
commit
f36570a357
2 changed files with 4 additions and 3 deletions
|
@ -15,6 +15,10 @@ if(DEFINED TC_RUNID)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
zephyr_library()
|
zephyr_library()
|
||||||
|
|
||||||
|
# For strtok_r() and strdup()
|
||||||
|
zephyr_library_compile_options(-D_POSIX_C_SOURCE=200809L)
|
||||||
|
|
||||||
zephyr_library_sources(
|
zephyr_library_sources(
|
||||||
src/ztest.c
|
src/ztest.c
|
||||||
src/ztest_error_hook.c
|
src/ztest_error_hook.c
|
||||||
|
|
|
@ -4,9 +4,6 @@
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#undef _POSIX_C_SOURCE
|
|
||||||
#define _POSIX_C_SOURCE 200809L
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "cmdline.h" /* native_sim command line options header */
|
#include "cmdline.h" /* native_sim command line options header */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue