From 97d52ff0b12623761233e7aed9017cbbfc708a22 Mon Sep 17 00:00:00 2001 From: Lephenixnoir Date: Sun, 16 May 2021 18:02:46 +0200 Subject: [PATCH] stdio: declare stdin, stdout and stderr on all targets This is needed for some basic stuff like assert. --- include/stdio.h | 10 +++++++++- include/target/casiowin-cg/bits/types/FILE.h | 7 +++++++ include/target/casiowin-fx/bits/types/FILE.h | 7 +++++++ include/target/gint/bits/types/FILE.h | 7 +++++++ 4 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 include/target/casiowin-cg/bits/types/FILE.h create mode 100644 include/target/casiowin-fx/bits/types/FILE.h create mode 100644 include/target/gint/bits/types/FILE.h diff --git a/include/stdio.h b/include/stdio.h index 7e0c728..b7c5fc0 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -2,8 +2,16 @@ # define __STDIO_H__ #include -#include #include +#include + +extern FILE *stdin; +extern FILE *stdout; +extern FILE *stderr; +/* Make them macros (7.19.1ยง3) */ +#define stdin stdin +#define stdout stdout +#define stderr stderr /* *printf() familly - formatted output conversion. */ extern int printf(const char *restrict format, ...); diff --git a/include/target/casiowin-cg/bits/types/FILE.h b/include/target/casiowin-cg/bits/types/FILE.h new file mode 100644 index 0000000..f65bcb4 --- /dev/null +++ b/include/target/casiowin-cg/bits/types/FILE.h @@ -0,0 +1,7 @@ +#ifndef __BITS_TYPES_FILE_H__ +# define __BITS_TYPES_FILE_H__ + +typedef struct { +} FILE; + +#endif /*__BITS_TYPES_FILE_H__*/ diff --git a/include/target/casiowin-fx/bits/types/FILE.h b/include/target/casiowin-fx/bits/types/FILE.h new file mode 100644 index 0000000..f65bcb4 --- /dev/null +++ b/include/target/casiowin-fx/bits/types/FILE.h @@ -0,0 +1,7 @@ +#ifndef __BITS_TYPES_FILE_H__ +# define __BITS_TYPES_FILE_H__ + +typedef struct { +} FILE; + +#endif /*__BITS_TYPES_FILE_H__*/ diff --git a/include/target/gint/bits/types/FILE.h b/include/target/gint/bits/types/FILE.h new file mode 100644 index 0000000..f65bcb4 --- /dev/null +++ b/include/target/gint/bits/types/FILE.h @@ -0,0 +1,7 @@ +#ifndef __BITS_TYPES_FILE_H__ +# define __BITS_TYPES_FILE_H__ + +typedef struct { +} FILE; + +#endif /*__BITS_TYPES_FILE_H__*/