fix some
This commit is contained in:
+2
-2
@@ -28,14 +28,14 @@ com_std_fd com_std_open(char const *path, uint32_t flags) {
|
||||
}
|
||||
|
||||
bool com_std_write(com_std_fd fd, void const *data, uint32_t bytes) {
|
||||
com_std_assert(fd != NULL && data != NULL && bytes != 0);
|
||||
com_std_assert(data != NULL && bytes != 0);
|
||||
bool s = fwrite(data, 1, bytes, fd) == bytes;
|
||||
fflush(fd);
|
||||
return s;
|
||||
}
|
||||
|
||||
int32_t com_std_read(com_std_fd fd, void *data, uint32_t upto) {
|
||||
com_std_assert(fd != NULL && data != NULL && upto != 0);
|
||||
com_std_assert(data != NULL && upto != 0);
|
||||
return fread(data, 1, upto, fd);
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -10,9 +10,9 @@
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#if COM_DEF_TARGET == COM_DEF_TARGET_WASM
|
||||
#define COM_STD_INFD 0
|
||||
#define COM_STD_OUTFD 1
|
||||
#if COM_DEF_TARGET != COM_DEF_TARGET_COSMO
|
||||
#define COM_STD_INFD (void *)0
|
||||
#define COM_STD_OUTFD (void *)1
|
||||
#else
|
||||
/* TODO: Make it more graceful, probably with static func. */
|
||||
#include <unistd.h>
|
||||
|
||||
Reference in New Issue
Block a user