Browse Source

posix: Use _POSIX_C_SOURCE=200809L instead of 200809

This constant is supposed to be defined as a long instead of an int,
presumably to support systems where int isn't large enough.

Signed-off-by: Keith Packard <keithp@keithp.com>
pull/68116/head
Keith Packard 2 years ago committed by Anas Nashif
parent
commit
3cc4c5eb7a
  1. 2
      arch/posix/CMakeLists.txt
  2. 2
      boards/posix/native_posix/hw_models_top.c
  3. 2
      scripts/native_simulator/Makefile
  4. 2
      scripts/native_simulator/common/src/nsi_hw_scheduler.c
  5. 2
      tests/lib/c_lib/common/src/main.c

2
arch/posix/CMakeLists.txt

@ -133,7 +133,7 @@ if (CONFIG_GPROF) @@ -133,7 +133,7 @@ if (CONFIG_GPROF)
target_link_options(native_simulator INTERFACE "-pg")
endif()
zephyr_compile_definitions(_POSIX_C_SOURCE=200809 _XOPEN_SOURCE=600 _XOPEN_SOURCE_EXTENDED)
zephyr_compile_definitions(_POSIX_C_SOURCE=200809L _XOPEN_SOURCE=600 _XOPEN_SOURCE_EXTENDED)
if (CONFIG_NATIVE_APPLICATION)
zephyr_ld_options(

2
boards/posix/native_posix/hw_models_top.c

@ -71,7 +71,7 @@ void hwm_signal_end_handler(int sig) @@ -71,7 +71,7 @@ void hwm_signal_end_handler(int sig)
* Therefore we set SA_RESETHAND: This way, the 2nd time the signal is received
* the default handler would be called to terminate the program no matter what.
*
* Note that SA_RESETHAND requires either _POSIX_C_SOURCE>=200809 or
* Note that SA_RESETHAND requires either _POSIX_C_SOURCE>=200809L or
* _XOPEN_SOURCE>=500
*/
void hwm_set_sig_handler(void)

2
scripts/native_simulator/Makefile

@ -60,7 +60,7 @@ NSI_OPT?=-O0 @@ -60,7 +60,7 @@ NSI_OPT?=-O0
# Warnings switches (for the runner itself)
NSI_WARNINGS?=-Wall -Wpedantic
# Preprocessor flags
NSI_CPPFLAGS?=-D_POSIX_C_SOURCE=200809 -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED
NSI_CPPFLAGS?=-D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED
NO_PIE_CO:=-fno-pie -fno-pic
DEPENDFLAGS:=-MMD -MP

2
scripts/native_simulator/common/src/nsi_hw_scheduler.c

@ -55,7 +55,7 @@ static void nsi_hws_signal_end_handler(int sig) @@ -55,7 +55,7 @@ static void nsi_hws_signal_end_handler(int sig)
* Therefore we set SA_RESETHAND: This way, the 2nd time the signal is received
* the default handler would be called to terminate the program no matter what.
*
* Note that SA_RESETHAND requires either _POSIX_C_SOURCE>=200809 or
* Note that SA_RESETHAND requires either _POSIX_C_SOURCE>=200809L or
* _XOPEN_SOURCE>=500
*/
static void nsi_hws_set_sig_handler(void)

2
tests/lib/c_lib/common/src/main.c

@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
*/
#ifdef CONFIG_NEWLIB_LIBC
#define _POSIX_C_SOURCE 200809
#define _POSIX_C_SOURCE 200809L
#endif
#include <zephyr/kernel.h>

Loading…
Cancel
Save