From 640ec0a9ea235943cce34b0c2c1d68a0d0940e54 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Sat, 5 Jan 2019 12:23:49 +0100 Subject: [PATCH] mescc: Mes C Library: Support GNU Awk: Add wchar_t. * include/sys/types.h (wchar_t): New typedef. --- include/sys/types.h | 9 +++++++++ lib/stdlib/mbstowcs.c | 4 ---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/include/sys/types.h b/include/sys/types.h index 1efde1f4..f1fcc126 100644 --- a/include/sys/types.h +++ b/include/sys/types.h @@ -135,6 +135,15 @@ typedef long ssize_t; typedef unsigned uid_t; #endif +#ifndef __WCHAR_T +#define __WCHAR_T +#ifndef __MES_WCHAR_T +#define __MES_WCHAR_T +#undef wchar_t +typedef int wchar_t; +#endif +#endif + #endif // ! WITH_GLIBC #endif // __MES_SYS_TYPES_H diff --git a/lib/stdlib/mbstowcs.c b/lib/stdlib/mbstowcs.c index 9330f355..db67c2d9 100644 --- a/lib/stdlib/mbstowcs.c +++ b/lib/stdlib/mbstowcs.c @@ -20,9 +20,6 @@ #include -#if !__MESC__ -typedef char wchar_t[]; - size_t mbstowcs (wchar_t *wstring, char const *string, size_t size) @@ -34,4 +31,3 @@ mbstowcs (wchar_t *wstring, char const *string, strcpy (wstring, string); return strlen (string); } -#endif