Skip to content

Commit 01b129b

Browse files
committed
[nrf fromtree] subsys/ipc icmsg_me.c: Fix ssize_t build error for some libCs
ssize_t is not part of the C library ISO standard subset, and as such one cannot expect a C library to expose the type by default. Some libraries like glibc do not expose this type in general, and trying to build using them results in build errors. There is 3 possible options: 1. Continue using ssize_t and: 1.a define _POSIX_C_SOURCE before including any header 1.b include sys/types.h directly (A bit uglier) 3. Not use ssize_t, and instead rely on ISO standard types Let's just go with 1.a assuming we want to keep using this type, as that is the correct way of getting this type defined. Signed-off-by: Alberto Escolar Piedras <[email protected]> (cherry picked from commit b6f1767)
1 parent 1ace171 commit 01b129b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

subsys/ipc/ipc_service/lib/icmsg_me.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7+
#undef _POSIX_C_SOURCE
8+
#define _POSIX_C_SOURCE 200809L
9+
710
#include <zephyr/ipc/icmsg_me.h>
811
#include <zephyr/sys/math_extras.h>
912

0 commit comments

Comments
 (0)