Skip to content

Commit 390a7f8

Browse files
tagunilnashif
authored andcommitted
lib: libc: arcmwdt: move ssize_t definition from the toolchain header
Until POSIX layer decoupling is done, we still need the size_t type definition across the codebase, but it should come through sys/types.h and not through toolchain-specific headers. Signed-off-by: Ilya Tagunov <[email protected]>
1 parent 9d229e5 commit 390a7f8

File tree

2 files changed

+9
-10
lines changed
  • include/zephyr/toolchain
  • lib/libc/arcmwdt/include/sys

2 files changed

+9
-10
lines changed

include/zephyr/toolchain/mwdt.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -114,16 +114,6 @@
114114

115115
#else /* defined(_ASMLANGUAGE) */
116116

117-
/* MWDT toolchain misses ssize_t definition which is used by Zephyr */
118-
#ifndef _SSIZE_T_DEFINED
119-
#define _SSIZE_T_DEFINED
120-
#ifdef CONFIG_64BIT
121-
typedef long ssize_t;
122-
#else
123-
typedef int ssize_t;
124-
#endif
125-
#endif /* _SSIZE_T_DEFINED */
126-
127117
#ifdef CONFIG_NEWLIB_LIBC
128118
#error "ARC MWDT doesn't support building with CONFIG_NEWLIB_LIBC as it doesn't have newlib"
129119
#endif /* CONFIG_NEWLIB_LIBC */

lib/libc/arcmwdt/include/sys/types.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,13 @@
1515
#define _UID_T_DECLARED
1616
#define _GID_T_DECLARED
1717

18+
#ifndef _SSIZE_T_DEFINED
19+
#define _SSIZE_T_DEFINED
20+
#ifdef CONFIG_64BIT
21+
typedef long ssize_t;
22+
#else /* CONFIG_64BIT */
23+
typedef int ssize_t;
24+
#endif /* CONFIG_64BIT */
25+
#endif /* _SSIZE_T_DEFINED */
26+
1827
#endif /* LIB_LIBC_ARCMWDT_INCLUDE_SYS_TYPES_H_ */

0 commit comments

Comments
 (0)