Skip to content

Commit cf83362

Browse files
dcodeIOkripken
authored andcommitted
Use 'BinaryenGlobalRef' instead of 'BinaryenImportRef' for globals in binaryen-c (#1270)
1 parent d38eead commit cf83362

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/binaryen-c.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ BinaryenFunctionRef BinaryenAddFunction(BinaryenModuleRef module, const char* na
746746
return ret;
747747
}
748748

749-
BinaryenImportRef BinaryenAddGlobal(BinaryenModuleRef module, const char* name, BinaryenType type, int8_t mutable_, BinaryenExpressionRef init) {
749+
BinaryenGlobalRef BinaryenAddGlobal(BinaryenModuleRef module, const char* name, BinaryenType type, int8_t mutable_, BinaryenExpressionRef init) {
750750
if (tracing) {
751751
std::cout << " BinaryenAddGlobal(the_module, \"" << name << "\", types[" << type << "], " << mutable_ << ", " << expressions[init] << ");\n";
752752
}

src/binaryen-c.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,9 @@ void BinaryenRemoveExport(BinaryenModuleRef module, const char* externalName);
355355

356356
// Globals
357357

358-
BinaryenImportRef BinaryenAddGlobal(BinaryenModuleRef module, const char* name, BinaryenType type, int8_t mutable_, BinaryenExpressionRef init);
358+
typedef void* BinaryenGlobalRef;
359+
360+
BinaryenGlobalRef BinaryenAddGlobal(BinaryenModuleRef module, const char* name, BinaryenType type, int8_t mutable_, BinaryenExpressionRef init);
359361

360362
// Function table. One per module
361363

0 commit comments

Comments
 (0)