Skip to content

Commit a9b1b27

Browse files
committed
Use appling_launch_v0 on Windows when available
1 parent 650529a commit a9b1b27

1 file changed

Lines changed: 22 additions & 1 deletion

File tree

src/launch.c

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,28 @@ appling_launch(const appling_platform_t *platform, const appling_app_t *app, con
105105
.name = name,
106106
};
107107

108-
err = launch(&info);
108+
err = -1;
109+
110+
#if defined(APPLING_OS_WIN32)
111+
appling_launch_cb launch_v0;
112+
int sym_err = uv_dlsym(&library, "appling_launch_v0", (void **) &launch_v0);
113+
if (sym_err == 0 && launch_v0 != NULL) {
114+
appling_launch_info_t info_v0 = info;
115+
info_v0.version = 0;
116+
info_v0.name = NULL;
117+
appling__bootstrap_log("launch-mode", "v0");
118+
err = launch_v0(&info_v0);
119+
} else {
120+
char buf[128];
121+
snprintf(buf, sizeof(buf), "sym err=%d", sym_err);
122+
appling__bootstrap_log("launch-v0-missing", buf);
123+
}
124+
#endif
125+
126+
if (err < 0) {
127+
appling__bootstrap_log("launch-mode", "default");
128+
err = launch(&info);
129+
}
109130

110131
uv_dlclose(&library);
111132

0 commit comments

Comments
 (0)