From d285a08a4690638ac453191164a7785d81ad64c5 Mon Sep 17 00:00:00 2001 From: "ALI Mohammadiyeh (Max Base)" Date: Sat, 28 Dec 2024 17:07:22 +0100 Subject: [PATCH] Fix error in webassembly build process --- src/main.c | 16 ++++++++++------ src/main.h | 4 ++-- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/main.c b/src/main.c index e36b6028..dde367a7 100644 --- a/src/main.c +++ b/src/main.c @@ -172,7 +172,7 @@ void help(char *app) { * @returns {void} * */ -void update() +void update(int argc, char **argv) { printf("Check latest version...\n"); @@ -180,14 +180,18 @@ void update() const char *port = "80"; const char *hostname = "versions.salamlang.ir"; + const char *path = #ifdef _WIN32 - const char *path = "/latest/windows"; +"/latest/windows"; #elif __APPLE__ - const char *path = "/latest/macos"; +"/latest/macos"; #elif __linux__ - const char *path = "/latest/linux"; +"/latest/linux"; +#elif __EMSCRIPTEN__ +"/latest/webassembly"; #else - printf("Unsupported OS\n"); +"Unsupported OS"; + printf("%s\n", path); exit(1); #endif @@ -276,7 +280,7 @@ void code(int argc, char **argv) * @returns {void} * */ -void execute(int argc, char** argv) +void execute(int argc, char **argv) { const char *path = argv[1]; if (!file_exists(path)) { diff --git a/src/main.h b/src/main.h index 6b33615f..66a3a49a 100644 --- a/src/main.h +++ b/src/main.h @@ -115,7 +115,7 @@ void help(char *app); * @returns {void} * */ -void update(); +void update(int argc, char **argv); /** * @@ -148,7 +148,7 @@ void code(int argc, char **argv); * @returns {void} * */ -void execute(int argc, char** argv); +void execute(int argc, char **argv); /** *