From e616d6120b0e19e53a0e73c84acf5196de4907e7 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Sun, 6 Aug 2017 13:53:56 +0200 Subject: [PATCH] mescc: Tinycc support: eputc. * mlibc/include/stdio.h (eputc): Declare. * mlibc/libc-gcc.c (eputc): * mlibc/libc-mes.c (eputc): New function. --- mlibc/include/stdio.h | 2 ++ mlibc/libc-gcc.c | 6 ++++++ mlibc/libc-mes.c | 6 ++++++ 3 files changed, 14 insertions(+) diff --git a/mlibc/include/stdio.h b/mlibc/include/stdio.h index e3ff2cf5..79db7d93 100644 --- a/mlibc/include/stdio.h +++ b/mlibc/include/stdio.h @@ -53,6 +53,7 @@ int fdputs (char const* s, int fd); #undef putc #endif +int eputc (int c); int eputs (char const* s); int fdputc (int c, int fd); int getchar (); @@ -94,6 +95,7 @@ typedef int FILE; typedef unsigned long size_t; #endif +int eputc (int c); int eputs (char const* s); int fclose (FILE *stream); FILE *fdopen (int fd, char const *mode); diff --git a/mlibc/libc-gcc.c b/mlibc/libc-gcc.c index 82e080d8..01745f8d 100644 --- a/mlibc/libc-gcc.c +++ b/mlibc/libc-gcc.c @@ -461,6 +461,12 @@ fdputs (char const* s, int fd) return 0; } +int +eputc (int c) +{ + return fdputc (c, STDERR); +} + int eputs (char const* s) { diff --git a/mlibc/libc-mes.c b/mlibc/libc-mes.c index c8abba5f..154d1f4b 100644 --- a/mlibc/libc-mes.c +++ b/mlibc/libc-mes.c @@ -139,6 +139,12 @@ strlen (char const* s) return i; } +int +eputc (int c) +{ + return fputc (c, 2); +} + int eputs (char const* s) {