port SQLite fork to wasm

This commit is contained in:
vms
2019-07-19 15:12:49 +03:00
parent bff864a802
commit 0d38bd3a72
13 changed files with 516 additions and 0 deletions

15
sdk/logger.c Normal file
View 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();
}