This commit is contained in:
ZZY
2025-04-01 00:13:21 +08:00
parent 2b4857001c
commit 74f43a1ab7
79 changed files with 2271 additions and 2861 deletions

View File

@ -21,7 +21,7 @@ extern rt_file_t rt_stderr;
typedef rt_file_t (*rt_fopen_t)(const char* file_name, const char* mode);
typedef int (*rt_fflush_t)(rt_file_t*file);
typedef int (*rt_fclose_t)(rt_file_t file);
typedef int (*rt_freads_t)(void * dst_buf, rt_size_t dst_size, rt_size_t elem_size, rt_size_t count, rt_file_t file);
typedef int (*rt_fread_t)(void * dst_buf, rt_size_t elem_size, rt_size_t count, rt_file_t file);
typedef int (*rt_fwrite_t)(const void * buf, rt_size_t size, rt_size_t count, rt_file_t file);
typedef int (*rt_fprintf_t)(void * file, const char *format, ...);
@ -36,7 +36,7 @@ typedef struct smcc_rt {
rt_fopen_t fopen;
rt_fflush_t fflush;
rt_fclose_t fclose;
rt_freads_t freads;
rt_fread_t fread;
rt_fwrite_t fwrite;
// Optional useful runtime
@ -47,18 +47,6 @@ typedef struct smcc_rt {
extern const smcc_rt_t rt;
// #ifndef NULL
// #ifdef __cplusplus
// #ifndef _WIN64
// #define NULL 0
// #else
// #define NULL 0LL
// #endif /* W64 */
// #else
// #define NULL ((void *)0)
// #endif
// #endif
#define NULL ((void *)0)
#endif

View File

@ -13,7 +13,7 @@ const smcc_rt_t rt = {
.fopen = (rt_fopen_t)fopen,
.fflush = (rt_fflush_t)fflush,
.fclose = (rt_fclose_t)fclose,
.freads = (rt_freads_t)fread_s,
.fread = (rt_fread_t)fread,
.fwrite = (rt_fwrite_t)fwrite,
._realloc = (rt_realloc_t)realloc,

View File

@ -1,6 +1,7 @@
#ifndef __SMCC_RT_TYPE_H__
#define __SMCC_RT_TYPE_H__
#include <stddef.h>
#include <stdint.h>
typedef int8_t i8_t;
@ -20,7 +21,7 @@ typedef intptr_t iptr_t;
typedef uintptr_t uptr_t;
typedef size_t usz_t;
typedef ssize_t isz_t;
// typedef ssize_t isz_t;
// typedef u32_t uw_t;
// typedef i32_t iw_t;