mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-25 20:51:44 +00:00
rtti & refactoring
This commit is contained in:
@ -1,7 +1,5 @@
|
||||
import { dirent, rwevent, fdstat, filestat, iovec, clocksubscription, fdsubscription, signal, dirprestat } from "bindings/wasi";
|
||||
|
||||
const WASM32 = 1;
|
||||
const WASM64 = 2;
|
||||
import { Target } from "common/target";
|
||||
|
||||
assert(offsetof<dirent>("next") == 0);
|
||||
assert(offsetof<dirent>("ino") == 8);
|
||||
@ -33,10 +31,10 @@ assert(offsetof<filestat>("ctim") == 48);
|
||||
assert(offsetof<filestat>() == 56);
|
||||
|
||||
assert(offsetof<iovec>("buf") == 0);
|
||||
if (ASC_TARGET == WASM32) {
|
||||
if (ASC_TARGET == Target.WASM32) {
|
||||
assert(offsetof<iovec>("buf_len") == 4);
|
||||
assert(offsetof<iovec>() == 8);
|
||||
} else if (ASC_TARGET == WASM64) {
|
||||
} else if (ASC_TARGET == Target.WASM64) {
|
||||
assert(offsetof<iovec>("buf_len") == 8);
|
||||
assert(offsetof<iovec>() == 16);
|
||||
} else {
|
||||
@ -58,10 +56,10 @@ assert(offsetof<fdsubscription>("fd") == 16);
|
||||
assert(offsetof<fdsubscription>() == 20);
|
||||
|
||||
assert(offsetof<dirprestat>("type") == 0);
|
||||
if (ASC_TARGET == WASM32) {
|
||||
if (ASC_TARGET == Target.WASM32) {
|
||||
assert(offsetof<dirprestat>("name_len") == 4);
|
||||
assert(offsetof<dirprestat>() == 8);
|
||||
} else if (ASC_TARGET == WASM64) {
|
||||
} else if (ASC_TARGET == Target.WASM64) {
|
||||
assert(offsetof<dirprestat>("name_len") == 8);
|
||||
assert(offsetof<dirprestat>() == 16);
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user