| 19 | // `wasmtime_extern_t`. |
| 20 | namespace detail { |
| 21 | static Extern cvt_extern(wasmtime_extern_t &e) { |
| 22 | switch (e.kind) { |
| 23 | case WASMTIME_EXTERN_FUNC: |
| 24 | return Func(e.of.func); |
| 25 | case WASMTIME_EXTERN_GLOBAL: |
| 26 | return Global(e.of.global); |
| 27 | case WASMTIME_EXTERN_MEMORY: |
| 28 | return Memory(e.of.memory); |
| 29 | case WASMTIME_EXTERN_TABLE: |
| 30 | return Table(e.of.table); |
| 31 | case WASMTIME_EXTERN_TAG: |
| 32 | return Tag(e.of.tag); |
| 33 | } |
| 34 | std::abort(); |
| 35 | } |
| 36 | |
| 37 | static void cvt_extern(const Extern &e, wasmtime_extern_t &raw) { |
| 38 | if (const auto *func = std::get_if<Func>(&e)) { |