cancel platform read interface

This commit is contained in:
lyon1998 2022-03-18 16:07:46 +08:00
parent fc4882ca1f
commit 21a8f63d92
3 changed files with 1 additions and 15 deletions

View File

@ -1300,7 +1300,7 @@ TEST(pikaMain, class_demo_1_file) {
Parser_multiLineToFile((char*)lines);
char bytecodebuff[4096] = {0};
FILE* f = __platform_fopen("pika_bytecode.bin", "r");
__platform_fread(bytecodebuff, 1, 4096, f);
fread(bytecodebuff, 1, 4096, f);
pikaVM_runByteCode(self, (uint8_t*)bytecodebuff);
/* assert */
EXPECT_STREQ(log_buff[0], (char*)"hello world\r\n");

View File

@ -139,16 +139,3 @@ PIKA_WEAK size_t __platform_fwrite(const void* ptr,
}
#endif
}
PIKA_WEAK size_t __platform_fread(void* ptr,
size_t size,
size_t n,
FILE* stream) {
#ifdef __linux
return fread(ptr, size, n, stream);
#else
__platform_printf("[error]: __platform_function need implementation!\r\n");
while (1) {
}
#endif
}

View File

@ -104,4 +104,3 @@ char __platform_getchar(void);
FILE* __platform_fopen(const char* filename, const char* modes);
int __platform_fclose(FILE* stream);
size_t __platform_fwrite(const void* ptr, size_t size, size_t n, FILE* stream);
size_t __platform_fread(void* ptr, size_t size, size_t n, FILE* stream);