From: Jan Nieuwenhuizen Date: Sun, 21 Jul 2019 11:23:49 +0000 (+0200) Subject: mescc: Mes C Library: Support GNU Awk: Add wchar_t. X-Git-Tag: v0.21~32 X-Git-Url: https://jxself.org/git/?p=mes.git;a=commitdiff_plain;h=9573f469f8c8c16d61a94737ae45e6264f2e5c81;hp=fe96cc37df39ebb6d6dfe213c489be9fc65cf6fb mescc: Mes C Library: Support GNU Awk: Add wchar_t. * include/sys/types.h (wchar_t): New typedef. --- diff --git a/include/sys/types.h b/include/sys/types.h index 510f512b..03dd1041 100644 --- a/include/sys/types.h +++ b/include/sys/types.h @@ -138,6 +138,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 // ! SYSTEM_LIBC #endif // __MES_SYS_TYPES_H diff --git a/lib/stdlib/mbstowcs.c b/lib/stdlib/mbstowcs.c index a948544d..0820c1ef 100644 --- a/lib/stdlib/mbstowcs.c +++ b/lib/stdlib/mbstowcs.c @@ -22,9 +22,6 @@ #include #include -#if !__MESC__ -typedef char wchar_t[]; - size_t mbstowcs (wchar_t * wstring, char const *string, size_t size) { @@ -35,4 +32,3 @@ mbstowcs (wchar_t * wstring, char const *string, size_t size) strcpy (wstring, string); return strlen (string); } -#endif