Skip to content

Commit 0446092

Browse files
committed
test
1 parent 99160af commit 0446092

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

samples/wasm-c-api/src/callback_chain.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,13 @@ main(int argc, const char *argv[])
161161
{
162162
// Initialize.
163163
printf("Initializing...\n");
164+
fflush(NULL);
164165
wasm_engine_t *engine = wasm_engine_new();
165166
wasm_store_t *store = wasm_store_new(engine);
166167

167168
// Load binary.
168169
printf("Loading binary...\n");
170+
fflush(NULL);
169171
#if WASM_ENABLE_AOT != 0 && WASM_ENABLE_INTERP == 0
170172
FILE *file = fopen("callback_chain.aot", "rb");
171173
#else
@@ -208,6 +210,7 @@ main(int argc, const char *argv[])
208210

209211
// Compile.
210212
printf("Compiling module...\n");
213+
fflush(NULL);
211214
own wasm_module_t *module = wasm_module_new(store, &binary);
212215
if (!module) {
213216
printf("> Error compiling module!\n");
@@ -218,6 +221,7 @@ main(int argc, const char *argv[])
218221

219222
// Instantiate.
220223
printf("Instantiating module...\n");
224+
fflush(NULL);
221225

222226
// Create external functions.
223227
printf("Creating callback...\n");
@@ -259,6 +263,7 @@ main(int argc, const char *argv[])
259263

260264
// Extract export.
261265
printf("Extracting export...\n");
266+
fflush(NULL);
262267
wasm_instance_exports(instance, &exports);
263268
if (!exports.size) {
264269
printf("> Error accessing exports!\n");
@@ -270,6 +275,7 @@ main(int argc, const char *argv[])
270275

271276
// Call.
272277
printf("Calling export...\n");
278+
fflush(NULL);
273279

274280
if (!call_wasm_function(e_on_start, NULL, NULL, "on_start")) {
275281
printf("> Error calling on_start\n");
@@ -285,10 +291,12 @@ main(int argc, const char *argv[])
285291

286292
// Shut down.
287293
printf("Shutting down...\n");
294+
fflush(NULL);
288295
wasm_store_delete(store);
289296
wasm_engine_delete(engine);
290297

291298
// All done.
292299
printf("Done.\n");
300+
fflush(NULL);
293301
return 0;
294302
}

0 commit comments

Comments
 (0)