mirror of https://github.com/flysand7/ciabatta.git
Change tinyrt inclusion macros to always be defined
This commit is contained in:
parent
d49add907c
commit
8a93fa68ff
|
@ -115,10 +115,8 @@ for line in io.lines(tinyrt_manifest_path) do
|
||||||
local api_name = line_it():upper()
|
local api_name = line_it():upper()
|
||||||
local has_impl = line_it()
|
local has_impl = line_it()
|
||||||
if has_impl == '0' or has_impl == '1' then
|
if has_impl == '0' or has_impl == '1' then
|
||||||
if has_impl == '1' then
|
local api_define = '#define RT_API_' .. api_name .. ' '..has_impl..'\n'
|
||||||
local api_define = '#define RT_API_' .. api_name .. '\n'
|
|
||||||
tinyrt_iface_hdr:write(api_define)
|
tinyrt_iface_hdr:write(api_define)
|
||||||
end
|
|
||||||
else
|
else
|
||||||
print('SYNTAX ERROR AT LINE '..i..': Expected 1 or 0 for the value')
|
print('SYNTAX ERROR AT LINE '..i..': Expected 1 or 0 for the value')
|
||||||
end
|
end
|
||||||
|
|
|
@ -39,11 +39,12 @@ static RT_Status rt_file_read(u64 size, void *buffer, RT_File *from, u64 *out_by
|
||||||
}
|
}
|
||||||
|
|
||||||
static RT_Status rt_file_write(RT_File *to, u64 size, void *buffer, u64 *out_bytes_written) {
|
static RT_Status rt_file_write(RT_File *to, u64 size, void *buffer, u64 *out_bytes_written) {
|
||||||
i64 bytes_written = syscall_write(to->fd, buffer, size);
|
// Call the syscall
|
||||||
if(bytes_written < 0) {
|
i64 status = syscall_write(to->fd, buffer, size);
|
||||||
return RT_STATUS_FILE_IO_ERROR;
|
if(-status == EBADF) return RT_ERROR_BAD_PARAM;
|
||||||
}
|
if(-status == EIO) return RT_STATUS_FILE_IO_ERROR;
|
||||||
*out_bytes_written = bytes_written;
|
if(-status > 0) return RT_STATUS_FILE_IO_ERROR;
|
||||||
|
*out_bytes_written = status;
|
||||||
return RT_STATUS_OK;
|
return RT_STATUS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ static RT_Status rt_init();
|
||||||
static RT_Status rt_deinit();
|
static RT_Status rt_deinit();
|
||||||
|
|
||||||
// File API
|
// File API
|
||||||
#if defined(RT_API_FILE)
|
#if RT_API_FILE == 1
|
||||||
struct RT_File typedef RT_File;
|
struct RT_File typedef RT_File;
|
||||||
struct RT_File {
|
struct RT_File {
|
||||||
union {
|
union {
|
||||||
|
|
Loading…
Reference in New Issue