mirror of https://github.com/tinygo-org/tinygo.git
Browse Source
This adds support for stdio in picolibc and fixes wasm_exec.js so that it can also support C puts. With this, C stdout works on all supported platforms.pull/2206/head
Ayke van Laethem
3 years ago
committed by
Ron Evans
11 changed files with 158 additions and 7 deletions
@ -1 +1 @@ |
|||
Subproject commit 80528c684b10aaee977397e7eb40c4784e6dc433 |
|||
Subproject commit f68b8204f797d6b3bfbc7c4da4d257961fbc8770 |
@ -0,0 +1,18 @@ |
|||
// This file is included in the picolibc build.
|
|||
// It makes stdio functions available to the C library.
|
|||
|
|||
#include <stdio.h> |
|||
#include <sys/cdefs.h> |
|||
|
|||
// Defined in the runtime package. Writes to the default console (usually, the
|
|||
// first UART or an USB-CDC device).
|
|||
int runtime_putchar(char, FILE*); |
|||
|
|||
// Define stdin, stdout, and stderr as a single object.
|
|||
// This object must not reside in ROM.
|
|||
static FILE __stdio = FDEV_SETUP_STREAM(runtime_putchar, NULL, NULL, _FDEV_SETUP_WRITE); |
|||
|
|||
// Define the underlying structs for stdin, stdout, and stderr.
|
|||
FILE *const stdin = &__stdio; |
|||
__strong_reference(stdin, stdout); |
|||
__strong_reference(stdin, stderr); |
Loading…
Reference in new issue