mirror of
https://github.com/fluencelabs/fluid
synced 2025-06-26 03:21:32 +00:00
the first version of c backend
This commit is contained in:
15
backend-c/sdk/logger.c
Normal file
15
backend-c/sdk/logger.c
Normal file
@ -0,0 +1,15 @@
|
||||
#include "logger.h"
|
||||
|
||||
#define __LOGGER_IMPORT(name) \
|
||||
__attribute__((__import_module__("logger"), __import_name__(#name)))
|
||||
|
||||
void __write(char ch) __LOGGER_IMPORT(write);
|
||||
void __flush() __LOGGER_IMPORT(flush);
|
||||
|
||||
void wasm_log(const char *str, int len) {
|
||||
for(int byteId = 0; byteId < len; ++byteId) {
|
||||
__write(str[byteId]);
|
||||
}
|
||||
|
||||
__flush();
|
||||
}
|
Reference in New Issue
Block a user