Skip to content

Commit e7f2019

Browse files
committed
posix: signal.h: do not define struct timespec when >= c11
C11 requires `<time.h>` to define `struct timespec`, so do not define it when C11 is already known. Signed-off-by: Chris Friedt <[email protected]>
1 parent fc09d4c commit e7f2019

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

include/zephyr/posix/posix_signal.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ typedef int uid_t;
4646
/* time_t must be defined by the libc time.h */
4747
#include <time.h>
4848

49+
#if __STDC_VERSION__ >= 201112L
50+
/* struct timespec must be defined in the libc time.h */
51+
#else
4952
#if !defined(_TIMESPEC_DECLARED) && !defined(__timespec_defined)
5053
struct timespec {
5154
time_t tv_sec;
@@ -54,6 +57,7 @@ struct timespec {
5457
#define _TIMESPEC_DECLARED
5558
#define __timespec_defined
5659
#endif
60+
#endif
5761

5862
/* sig_atomic_t must be defined by the libc signal.h */
5963

0 commit comments

Comments
 (0)