Making some MSL_C progress (#549)

This commit is contained in:
mrshigure 2025-01-27 16:50:48 -08:00 committed by GitHub
parent 32fdc38925
commit 2309176a5c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
23 changed files with 1456 additions and 263 deletions

View file

@ -85,6 +85,7 @@ typedef struct _FILE {
file_modes file_mode;
file_states file_state;
char is_dynamically_allocated;
char char_buffer;
char char_buffer_overflow;
char ungetc_buffer[2];
@ -104,19 +105,14 @@ typedef struct _FILE {
__io_proc write_fn;
__close_proc close_fn;
__idle_proc idle_fn;
struct _FILE* next_file_struct;
} FILE;
typedef struct _files {
FILE _stdin;
FILE _stdout;
FILE _stderr;
} files;
#define _IONBF 0
#define _IOLBF 1
#define _IOFBF 2
extern files __files;
extern FILE __files[];
extern int __close_console(__file_handle file);
extern int __write_console(__file_handle file, unsigned char* buf,
size_t* count, __idle_proc idle_fn);

View file

@ -6,8 +6,8 @@
#include "PowerPC_EABI_Support/Msl/MSL_C/MSL_Common/printf.h" // IWYU pragma: export
#include "PowerPC_EABI_Support/Msl/MSL_C/MSL_Common/extras.h" // IWYU pragma: export
#define stdin (&__files._stdin)
#define stdout (&__files._stdout)
#define stderr (&__files._stderr)
#define stdin (&__files[0])
#define stdout (&__files[1])
#define stderr (&__files[2])
#endif