From: Tormod Volden Date: Tue, 14 Apr 2015 21:23:12 +0000 (+0200) Subject: Library: Add putchar_wrapper.c for use with libgcc X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=bd7369df56be2cf76c570db355f34f6fc74a5ca2;p=FUZIX.git Library: Add putchar_wrapper.c for use with libgcc Once we link in libgcc.a it seems we need the putchar without underscore (in C). Signed-off-by: Tormod Volden --- diff --git a/Library/libs/Makefile.6809 b/Library/libs/Makefile.6809 index 784ed1da..a571c97b 100644 --- a/Library/libs/Makefile.6809 +++ b/Library/libs/Makefile.6809 @@ -27,7 +27,7 @@ SRC_C += gmtime.c gmtime_r.c grent.c index.c isatty.c killpg.c SRC_C += libintl.c SRC_C += localtim.c localtim_r.c lseek.c lsearch.c lstat.c ltoa.c ltostr.c SRC_C += malloc.c mkfifo.c mkstemps.c nanosleep.c opendir.c pause.c perror.c -SRC_C += popen.c printf.c putenv.c putgetch.c putpwent.c pwent.c qsort.c +SRC_C += popen.c printf.c putenv.c putchar_wrapper.c putpwent.c pwent.c qsort.c SRC_C += raise.c rand.c readdir.c readlink.c realloc.c regerror.c SRC_C += regsub.c remove.c rewind.c rindex.c setbuffer.c setenv.c setjmp.c SRC_C += setlocale.c setvbuf.c settimeofday.c sleep.c sprintf.c diff --git a/Library/libs/putchar_wrapper.c b/Library/libs/putchar_wrapper.c new file mode 100644 index 00000000..e0a0089e --- /dev/null +++ b/Library/libs/putchar_wrapper.c @@ -0,0 +1,7 @@ +/* This little wrapper seems needed when linking with libgcc */ + +int putchar(int ch) +{ + unsigned char c = ch; + return write(1, &c, 1); +}