Skip to content

Commit

Permalink
Fix error in webassembly build process
Browse files Browse the repository at this point in the history
  • Loading branch information
BaseMax committed Dec 28, 2024
1 parent 1848bce commit d285a08
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
16 changes: 10 additions & 6 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,22 +172,26 @@ void help(char *app) {
* @returns {void}
*
*/
void update()
void update(int argc, char **argv)
{
printf("Check latest version...\n");

const char *output_file = "update.tmp";
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

Expand Down Expand Up @@ -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)) {
Expand Down
4 changes: 2 additions & 2 deletions src/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ void help(char *app);
* @returns {void}
*
*/
void update();
void update(int argc, char **argv);

/**
*
Expand Down Expand Up @@ -148,7 +148,7 @@ void code(int argc, char **argv);
* @returns {void}
*
*/
void execute(int argc, char** argv);
void execute(int argc, char **argv);

/**
*
Expand Down

0 comments on commit d285a08

Please sign in to comment.