diff --git a/include/sys/types.h b/include/sys/types.h index b9e0d553..29c505fa 100644 --- a/include/sys/types.h +++ b/include/sys/types.h @@ -165,9 +165,15 @@ typedef unsigned uid_t; #ifndef __MES_WCHAR_T #define __MES_WCHAR_T #undef wchar_t +// The compiler names the type of a wide character literal for its +// target; MesCC names none. +#ifdef __WCHAR_TYPE__ +typedef __WCHAR_TYPE__ wchar_t; +#else typedef int wchar_t; #endif #endif +#endif #endif // ! SYSTEM_LIBC diff --git a/lib/stdio/vfprintf.c b/lib/stdio/vfprintf.c index 839ad897..e1c1c971 100644 --- a/lib/stdio/vfprintf.c +++ b/lib/stdio/vfprintf.c @@ -23,6 +23,12 @@ #include #include +/* A compiler's own stdarg.h defines va_arg alone, and its va_arg reads a + double as one. */ +#ifndef va_arg8 +#define va_arg8(ap, type) va_arg (ap, type) +#endif + int vfprintf (FILE * f, char const *format, va_list ap) { diff --git a/lib/stdio/vsnprintf.c b/lib/stdio/vsnprintf.c index ff1b3c2b..d8b3b5c8 100644 --- a/lib/stdio/vsnprintf.c +++ b/lib/stdio/vsnprintf.c @@ -23,6 +23,12 @@ #include #include +/* A compiler's own stdarg.h defines va_arg alone, and its va_arg reads a + double as one. */ +#ifndef va_arg8 +#define va_arg8(ap, type) va_arg (ap, type) +#endif + int vsnprintf (char *str, size_t size, char const *format, va_list ap) {