//
//  m3_api_defs.h
//
//  Created by Volodymyr Shymanskyy on 12/20/19.
//  Copyright © 2019 Volodymyr Shymanskyy. All rights reserved.
//

#ifndef m3_api_defs_h
#define m3_api_defs_h

#include "m3_core.h"

#define m3ApiReturnType(TYPE)      TYPE* raw_return = ((TYPE*) (_sp));
#define m3ApiGetArg(TYPE, NAME)    TYPE NAME = * ((TYPE *) (_sp++));
#define m3ApiGetArgMem(TYPE, NAME) TYPE NAME = (TYPE) (_mem + * (u32 *) _sp++);

#define m3ApiRawFunction(NAME)     m3ret_t NAME (IM3Runtime runtime, u64 * _sp, u8 * _mem)
#define m3ApiReturn(VALUE)         { *raw_return = (VALUE); return NULL; }

#endif /* m3_api_defs_h */

//
//  m3_api_defs.h
//
//  Created by Volodymyr Shymanskyy on 12/20/19.
//  Copyright © 2019 Volodymyr Shymanskyy. All rights reserved.
//

#ifndef m3_api_defs_h
#define m3_api_defs_h

#include "m3_core.h"

#define m3ApiReturnType(TYPE)      TYPE* raw_return = ((TYPE*) (_sp));
#define m3ApiGetArg(TYPE, NAME)    TYPE NAME = * ((TYPE *) (_sp++));
#define m3ApiGetArgMem(TYPE, NAME) TYPE NAME = (TYPE) (_mem + * (u32 *) _sp++);

#define m3ApiRawFunction(NAME)     void NAME (IM3Runtime runtime, u64 * _sp, u8 * _mem)
#define m3ApiReturn(VALUE)         { *raw_return = (VALUE); return; }

#endif /* m3_api_defs_h */

--- 
+++ 
@@ -14,7 +14,7 @@
 #define m3ApiGetArg(TYPE, NAME)    TYPE NAME = * ((TYPE *) (_sp++));
 #define m3ApiGetArgMem(TYPE, NAME) TYPE NAME = (TYPE) (_mem + * (u32 *) _sp++);
 
-#define m3ApiRawFunction(NAME)     void NAME (IM3Runtime runtime, u64 * _sp, u8 * _mem)
-#define m3ApiReturn(VALUE)         { *raw_return = (VALUE); return; }
+#define m3ApiRawFunction(NAME)     m3ret_t NAME (IM3Runtime runtime, u64 * _sp, u8 * _mem)
+#define m3ApiReturn(VALUE)         { *raw_return = (VALUE); return NULL; }
 
 #endif /* m3_api_defs_h */
Fix type missmatch (crucial for wasienv)
