Skip to content

Commit 9c8e4db

Browse files
committed
Switch calls to get_func_type wasm2c API to always use ints instead of enums
1 parent 79f4852 commit 9c8e4db

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

include/rlbox_wasm2c_sandbox.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ namespace wasm2c_detail {
201201
static_assert(std::is_void_v<T>, "Missing specialization");
202202
using type = void;
203203
// wasm2c has no void type so use i32 for now
204-
static constexpr wasm_rt_type_t wasm2c_type = WASM_RT_I32;
204+
static constexpr int wasm2c_type = (int) WASM_RT_I32;
205205
};
206206

207207
template<typename T>
@@ -211,7 +211,7 @@ namespace wasm2c_detail {
211211
sizeof(uint32_t)>>
212212
{
213213
using type = uint32_t;
214-
static constexpr wasm_rt_type_t wasm2c_type = WASM_RT_I32;
214+
static constexpr int wasm2c_type = (int) WASM_RT_I32;
215215
};
216216

217217
template<typename T>
@@ -222,23 +222,23 @@ namespace wasm2c_detail {
222222
sizeof(T) <= sizeof(uint64_t)>>
223223
{
224224
using type = uint64_t;
225-
static constexpr wasm_rt_type_t wasm2c_type = WASM_RT_I64;
225+
static constexpr int wasm2c_type = (int) WASM_RT_I64;
226226
};
227227

228228
template<typename T>
229229
struct convert_type_to_wasm_type<T,
230230
std::enable_if_t<std::is_same_v<T, float>>>
231231
{
232232
using type = T;
233-
static constexpr wasm_rt_type_t wasm2c_type = WASM_RT_F32;
233+
static constexpr int wasm2c_type = (int) WASM_RT_F32;
234234
};
235235

236236
template<typename T>
237237
struct convert_type_to_wasm_type<T,
238238
std::enable_if_t<std::is_same_v<T, double>>>
239239
{
240240
using type = T;
241-
static constexpr wasm_rt_type_t wasm2c_type = WASM_RT_F64;
241+
static constexpr int wasm2c_type = (int) WASM_RT_F64;
242242
};
243243

244244
template<typename T>
@@ -249,7 +249,7 @@ namespace wasm2c_detail {
249249
// pointers are 32 bit indexes in wasm
250250
// class paramters are passed as a pointer to an object in the stack or heap
251251
using type = uint32_t;
252-
static constexpr wasm_rt_type_t wasm2c_type = WASM_RT_I32;
252+
static constexpr int wasm2c_type = (int) WASM_RT_I32;
253253
};
254254

255255
///////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)