From b0c3ed4f1dbab51a15c420a71c750b2552aedea8 Mon Sep 17 00:00:00 2001 From: Eric Brombaugh <ebrombaugh1@cox.net> Date: Tue, 11 Apr 2023 21:27:47 -0700 Subject: [PATCH] Added putchar() to fix linker errors when using printf on single char strings. --- ch32v003fun/ch32v003fun.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ch32v003fun/ch32v003fun.c b/ch32v003fun/ch32v003fun.c index 1a77cbc..aec6ade 100644 --- a/ch32v003fun/ch32v003fun.c +++ b/ch32v003fun/ch32v003fun.c @@ -32,7 +32,11 @@ int printf(const char* format, ...) return ret_status; } - +int putchar(int c) +{ + return _write( 0, (const char *)(&c), 1 ); +} + /* Some stuff from MUSL -- GitLab