support app framework base library in assemblyscript (#164)

This commit is contained in:
Xu Jun
2020-02-13 15:51:22 +08:00
committed by GitHub
parent b5cbc02e90
commit 5a10651dd0
17 changed files with 1083 additions and 40 deletions

View File

@ -0,0 +1,15 @@
/*
* Copyright (C) 2019 Intel Corporation. All rights reserved.
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
*/
@external("env", "printf")
declare function printf(a: ArrayBuffer): i32;
export function log(a: string): void {
printf(String.UTF8.encode(a + '\n', true));
}
export function log_number(a: number): void {
printf(String.UTF8.encode(a.toString() + '\n'));
}