Skip to content

Commit bd2193b

Browse files
authored
Remove emscripten_sync_run_in_main_thread_xprintf_varargs (#15235)
I can't see where this function was ever used, and it not declared in any header. This function was first added in 3b99bb7 and at that point was used to implement fprintf and friends in src/library.js, but then that code was completely removed in d92efe0.
1 parent 8e16c4a commit bd2193b

File tree

1 file changed

+0
-24
lines changed

1 file changed

+0
-24
lines changed

system/lib/pthread/library_pthread.c

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#include <stdatomic.h>
1919
#include <stdarg.h>
2020
#include <stdbool.h>
21-
#include <stdio.h>
2221
#include <stdlib.h>
2322
#include <sys/ioctl.h>
2423
#include <sys/mman.h>
@@ -490,29 +489,6 @@ void* emscripten_sync_run_in_main_thread_2(
490489
return q.returnValue.vp;
491490
}
492491

493-
void* emscripten_sync_run_in_main_thread_xprintf_varargs(
494-
int function, int param0, const char* format, ...) {
495-
va_list args;
496-
va_start(args, format);
497-
const int CAP = 128;
498-
char str[CAP];
499-
char* s = str;
500-
int len = vsnprintf(s, CAP, format, args);
501-
if (len >= CAP) {
502-
s = (char*)malloc(len + 1);
503-
va_start(args, format);
504-
len = vsnprintf(s, len + 1, format, args);
505-
}
506-
em_queued_call q = {function};
507-
q.args[0].vp = (void*)param0;
508-
q.args[1].vp = s;
509-
q.returnValue.vp = 0;
510-
emscripten_sync_run_in_main_thread(&q);
511-
if (s != str)
512-
free(s);
513-
return q.returnValue.vp;
514-
}
515-
516492
void* emscripten_sync_run_in_main_thread_3(
517493
int function, void* arg1, void* arg2, void* arg3) {
518494
em_queued_call q = {function};

0 commit comments

Comments
 (0)