diff --git a/mlibc/libc-mes+tcc.c b/mlibc/libc-mes+tcc.c index e075768f..24657e96 100644 --- a/mlibc/libc-mes+tcc.c +++ b/mlibc/libc-mes+tcc.c @@ -335,8 +335,27 @@ time_t time (time_t *tloc) int vsnprintf (char *str, size_t size, char const *format, va_list ap) { - eputs ("vsnprintf stub\n"); - return 0; + char const *p = format; + while (*p) + if (*p != '%') + *str++ = *p++; + else + { + p++; + char c = *p; + switch (c) + { + case '%': {*str++ = *p; break;} + case 'c': {char c; c = va_arg (ap, char); *str++=c; break;} + case 'd': {int d; d = va_arg (ap, int); strcpy (str, itoa (d)); break;} + case 's': {char *s; s = va_arg (ap, char *); strcpy (str, s); break;} + default: {*str++ = *p; break;} + } + p++; + } + va_end (ap); + *str = 0; + return strlen (str); } void * diff --git a/module/language/c99/compiler.mes b/module/language/c99/compiler.mes index 36cd72cd..1d14824b 100644 --- a/module/language/c99/compiler.mes +++ b/module/language/c99/compiler.mes @@ -1283,6 +1283,8 @@ (define (ast-type->type info o) (pmatch o ((p-expr ,expr) (ast-type->type info (p-expr->type info o))) + ((pre-inc ,expr) (ast-type->type info expr)) + ((post-inc ,expr) (ast-type->type info expr)) ((decl-spec-list ,type-spec) (ast-type->type info type-spec)) ((decl-spec-list (type-qual ,qual) (type-spec (fixed-type ,type)))