Single public header
#include <stdint.h>
#include <inttypes.h>
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
typedef const char * M3Result;
struct M3Runtime; typedef struct M3Runtime * IM3Runtime;
@@ -116,7 +120,7 @@ d_m3ErrorConst (wasmUnderrun, "underrun while parsing WASM binary")
d_m3ErrorConst (wasmOverrun, "overrun while parsing WASM binary")
d_m3ErrorConst (wasmMissingInitExpr, "missing init_expr in WASM binary")
d_m3ErrorConst (lebOverflow, "LEB encoded value overflow")
-d_m3ErrorConst (missingUTF8, "zero length UTF-8 string")
+d_m3ErrorConst (missingUTF8, "invalid length UTF-8 string")
d_m3ErrorConst (wasmSectionUnderrun, "section underrun while parsing WASM binary")
d_m3ErrorConst (wasmSectionOverrun, "section overrun while parsing WASM binary")
d_m3ErrorConst (invalidTypeId, "unknown value_type")
@@ -145,7 +149,7 @@ d_m3ErrorConst (trapOutOfBoundsMemoryAccess, "[trap] out of bounds memory access
d_m3ErrorConst (trapDivisionByZero, "[trap] integer divide by zero")
d_m3ErrorConst (trapIntegerOverflow, "[trap] integer overflow")
d_m3ErrorConst (trapIntegerConversion, "[trap] invalid conversion to integer")
-d_m3ErrorConst (trapTableIndexOutOfRange, "[trap] table index is out of range")
+d_m3ErrorConst (trapTableIndexOutOfRange, "[trap] undefined element")
d_m3ErrorConst (trapExit, "[trap] program called exit")
d_m3ErrorConst (runtimeTrap, "[trap] unspecified runtime trap")
@@ -253,5 +257,8 @@ typedef int64_t (* M3Callback) (IM3Function i_currentFunction, void * i_ref);
void m3_PrintM3Info (void);
void m3_PrintProfilerInfo (void);
+#if defined(__cplusplus)
+}
+#endif
#endif /* m3_h */
