posix: manually define _POSIX_C_SOURCE in lib/posix
This PR adds declarations for the application conformance feature test macro _POSIX_C_SOURCE. It needs to be defined to value greater than or equal to 200112L by the appplication. However, Zephyr currently does not have a simple and consistent means of specifying this value for POSIX samples, tests, applications, and other libraries. Signed-off-by: Christopher Friedt <cfriedt@meta.com>
This commit is contained in:
parent
447fc24352
commit
529023e6f8
1 changed files with 6 additions and 0 deletions
|
|
@ -1,6 +1,12 @@
|
|||
# Copyright (c) 2024 Meta
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
zephyr_library()
|
||||
# For setenv() and unsetenv()
|
||||
zephyr_library_compile_options(-U_POSIX_C_SOURCE -D_POSIX_C_SOURCE=200809L)
|
||||
# For getenv_r() visibility
|
||||
zephyr_library_compile_definitions(_BSD_SOURCE)
|
||||
|
||||
zephyr_library_sources_ifdef(CONFIG_POSIX_SHELL posix_shell.c)
|
||||
zephyr_library_sources_ifdef(CONFIG_POSIX_UNAME_SHELL uname.c)
|
||||
zephyr_library_sources_ifdef(CONFIG_POSIX_ENV_SHELL env.c)
|
||||
|
|
|
|||
Loading…
Reference in a new issue