import { dirent, rwevent, fdstat, filestat, iovec, clocksubscription, fdsubscription, signal, dirprestat } from "bindings/wasi"; const WASM32 = 1; const WASM64 = 2; assert(offsetof("next") == 0); assert(offsetof("ino") == 8); assert(offsetof("namlen") == 16); assert(offsetof("type") == 20); assert(offsetof() == 24); assert(offsetof("userdata") == 0); assert(offsetof("error") == 8); assert(offsetof("type") == 10); assert(offsetof("nbytes") == 16); assert(offsetof("flags") == 24); assert(offsetof() == 32); assert(offsetof("filetype") == 0); assert(offsetof("flags") == 2); assert(offsetof("rights_base") == 8); assert(offsetof("rights_inheriting") == 16); assert(offsetof() == 24); assert(offsetof("dev") == 0); assert(offsetof("ino") == 8); assert(offsetof("filetype") == 16); assert(offsetof("nlink") == 20); assert(offsetof("size") == 24); assert(offsetof("atim") == 32); assert(offsetof("mtim") == 40); assert(offsetof("ctim") == 48); assert(offsetof() == 56); assert(offsetof("buf") == 0); if (ASC_TARGET == WASM32) { assert(offsetof("buf_len") == 4); assert(offsetof() == 8); } else if (ASC_TARGET == WASM64) { assert(offsetof("buf_len") == 8); assert(offsetof() == 16); } else { assert(false); } assert(offsetof("userdata") == 0); assert(offsetof("type") == 8); assert(offsetof("identifier") == 16); assert(offsetof("clock_id") == 24); assert(offsetof("timeout") == 32); assert(offsetof("precision") == 40); assert(offsetof("flags") == 48); assert(offsetof() == 56); assert(offsetof("userdata") == 0); assert(offsetof("type") == 8); assert(offsetof("fd") == 16); assert(offsetof() == 20); assert(offsetof("type") == 0); if (ASC_TARGET == WASM32) { assert(offsetof("name_len") == 4); assert(offsetof() == 8); } else if (ASC_TARGET == WASM64) { assert(offsetof("name_len") == 8); assert(offsetof() == 16); } else { assert(false); } // check assignability of mimicked typed enums var sig: signal = signal.HUP; sig = signal.KILL;