Skip to content

Commit c68976f

Browse files
committed
thrift: Define module-wide _POSIX_C_SOURCE feature test macro
The Thrift library makes use of POSIX C functions such as ctime_r(), which are not part of the ISO C standard. This commit adds a Thrift module-wide `_POSIX_C_SOURCE` feature test macro definition in order to ensure that the required POSIX C functions are available when compiling the Thrift library. Note that this was not caught earlier because Newlib and older versions of Picolibc did not properly fence off some POSIX functions behind the feature test macros. Signed-off-by: Stephanos Ioannidis <[email protected]>
1 parent 0b12681 commit c68976f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

modules/thrift/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,7 @@ zephyr_library_sources_ifdef(CONFIG_THRIFT_SSL_SOCKET
3939
# needed because std::iterator was deprecated with -std=c++17
4040
zephyr_library_compile_options(-Wno-deprecated-declarations)
4141

42+
# needed for ctime_r
43+
zephyr_library_compile_definitions(_POSIX_C_SOURCE=200809L)
44+
4245
endif(CONFIG_THRIFT)

0 commit comments

Comments
 (0)