1+ #ifndef CMCPP_WAMR_HPP
2+ #define CMCPP_WAMR_HPP
3+
14#include " wasm_export.h"
25#include " cmcpp.hpp"
36
47namespace cmcpp
58{
69
7- void trap (const char *msg)
10+ inline void trap (const char *msg)
811 {
912 throw new std::runtime_error (msg);
1013 }
1114
12- std::vector<wasm_val_t > wasmVal2wam_val_t (const WasmValVector &values)
15+ inline std::vector<wasm_val_t > wasmVal2wam_val_t (const WasmValVector &values)
1316 {
1417 std::vector<wasm_val_t > result;
1518 result.reserve (values.size ());
@@ -41,7 +44,7 @@ namespace cmcpp
4144 return result;
4245 }
4346
44- WasmValVector wam_val_t2wasmVal (size_t count, const wasm_val_t *values)
47+ inline WasmValVector wam_val_t2wasmVal (size_t count, const wasm_val_t *values)
4548 {
4649 WasmValVector result;
4750 result.reserve (count);
@@ -121,7 +124,7 @@ namespace cmcpp
121124 };
122125 }
123126
124- std::pair<void *, size_t > convert (void *dest, uint32_t dest_byte_len, const void *src, uint32_t src_byte_len, Encoding from_encoding, Encoding to_encoding)
127+ inline std::pair<void *, size_t > convert (void *dest, uint32_t dest_byte_len, const void *src, uint32_t src_byte_len, Encoding from_encoding, Encoding to_encoding)
125128 {
126129 if (from_encoding == to_encoding)
127130 {
@@ -236,9 +239,11 @@ namespace cmcpp
236239 return symbol;
237240 }
238241
239- bool host_module (const char *module_name, NativeSymbol *native_symbols, uint32_t n_native_symbols)
242+ inline bool host_module (const char *module_name, NativeSymbol *native_symbols, uint32_t n_native_symbols)
240243 {
241244 return wasm_runtime_register_natives_raw (module_name, native_symbols, n_native_symbols);
242245 }
243246
244247}
248+
249+ #endif
0 commit comments