diff options
Diffstat (limited to 'test/example/cpp-threads.cpp')
-rw-r--r-- | test/example/cpp-threads.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/example/cpp-threads.cpp b/test/example/cpp-threads.cpp index 72724d8b6..e59bd5243 100644 --- a/test/example/cpp-threads.cpp +++ b/test/example/cpp-threads.cpp @@ -13,8 +13,8 @@ void worker() { BinaryenModuleRef module = BinaryenModuleCreate(); // Create a function type for i32 (i32, i32) - BinaryenType params[2] = { BinaryenTypeInt32(), BinaryenTypeInt32() }; - BinaryenFunctionTypeRef iii = BinaryenAddFunctionType(module, "iii", BinaryenTypeInt32(), params, 2); + BinaryenType ii_[2] = {BinaryenTypeInt32(), BinaryenTypeInt32()}; + BinaryenType ii = BinaryenTypeCreate(ii_, 2); // Get the 0 and 1 arguments, and add them BinaryenExpressionRef x = BinaryenLocalGet(module, 0, BinaryenTypeInt32()), @@ -25,7 +25,8 @@ void worker() { // Create the add function // Note: no additional local variables // Note: no basic blocks here, we are an AST. The function body is just an expression node. - BinaryenFunctionRef adder = BinaryenAddFunction(module, "adder", iii, NULL, 0, ret); + BinaryenFunctionRef adder = + BinaryenAddFunction(module, "adder", ii, BinaryenTypeInt32(), NULL, 0, ret); // validate it assert(BinaryenModuleValidate(module)); @@ -38,8 +39,7 @@ void worker() { BinaryenModuleDispose(module); } -int main() -{ +int main() { std::vector<std::thread> threads; std::cout << "create threads...\n"; |