diff --git a/include/zephyr/toolchain/mwdt.h b/include/zephyr/toolchain/mwdt.h index 48ce1b69c7d..715c34bd814 100644 --- a/include/zephyr/toolchain/mwdt.h +++ b/include/zephyr/toolchain/mwdt.h @@ -114,16 +114,6 @@ #else /* defined(_ASMLANGUAGE) */ -/* MWDT toolchain misses ssize_t definition which is used by Zephyr */ -#ifndef _SSIZE_T_DEFINED -#define _SSIZE_T_DEFINED -#ifdef CONFIG_64BIT - typedef long ssize_t; -#else - typedef int ssize_t; -#endif -#endif /* _SSIZE_T_DEFINED */ - #ifdef CONFIG_NEWLIB_LIBC #error "ARC MWDT doesn't support building with CONFIG_NEWLIB_LIBC as it doesn't have newlib" #endif /* CONFIG_NEWLIB_LIBC */ diff --git a/lib/libc/arcmwdt/include/sys/types.h b/lib/libc/arcmwdt/include/sys/types.h index 1024f22834c..d570f78592d 100644 --- a/lib/libc/arcmwdt/include/sys/types.h +++ b/lib/libc/arcmwdt/include/sys/types.h @@ -15,4 +15,13 @@ #define _UID_T_DECLARED #define _GID_T_DECLARED +#ifndef _SSIZE_T_DEFINED +#define _SSIZE_T_DEFINED +#ifdef CONFIG_64BIT +typedef long ssize_t; +#else /* CONFIG_64BIT */ +typedef int ssize_t; +#endif /* CONFIG_64BIT */ +#endif /* _SSIZE_T_DEFINED */ + #endif /* LIB_LIBC_ARCMWDT_INCLUDE_SYS_TYPES_H_ */