diff --git a/premake4.lua b/premake4.lua index 7365d4762..561bad8ac 100644 --- a/premake4.lua +++ b/premake4.lua @@ -483,6 +483,7 @@ function build_link_configuration( package_name, use_ee_icon ) linkoptions { "-O3 -s TOTAL_MEMORY=67108864" } linkoptions { "-s USE_SDL=2" } buildoptions { "-O3 -s USE_SDL=2 -s PRECISE_F32=1 -s ENVIRONMENT=worker,web" } + defines { "NO_POSIX_SPAWN" } if _OPTIONS["with-emscripten-pthreads"] then buildoptions { "-s USE_PTHREADS=1" } diff --git a/src/eepp/ui/doc/syntaxdefinitionmanager.cpp b/src/eepp/ui/doc/syntaxdefinitionmanager.cpp index 8c9a9f6bc..b810cea67 100644 --- a/src/eepp/ui/doc/syntaxdefinitionmanager.cpp +++ b/src/eepp/ui/doc/syntaxdefinitionmanager.cpp @@ -230,6 +230,12 @@ SyntaxDefinitionManager::SyntaxDefinitionManager() { { { "-?%d+[%d%.eE]*" }, "number" }, { { "-?%.?%d+" }, "number" }, { { "[%+%-=/%*%^%%<>!~|&]" }, "operator" }, + { { "([%w_][%w_]+)%.([%w_][%w%d_]*)%s*(=)%s*(function)" }, + { "normal", "keyword2", "function", "operator", "keyword" } }, + { { "([%w_][%w_]+)%.([%w_][%w%d_]*)%s*(=)%s*(async%s*function)" }, + { "normal", "keyword2", "function", "operator", "keyword" } }, + { { "([%w_][%w_]+)%.([%w_][%w%d_]*)%s*(=)%s*%b()%s*(=>)" }, + { "normal", "keyword2", "function", "operator", "operator" } }, { { "[%a_][%w_]*%s*%f[(]" }, "function" }, { { "[%a_][%w_]*" }, "symbol" }, }, @@ -251,7 +257,7 @@ SyntaxDefinitionManager::SyntaxDefinitionManager() { { "implements", "keyword" }, { "Array", "keyword2" }, { "any", "keyword" }, { "from", "keyword" }, { "public", "keyword" }, { "private", "keyword" }, { "declare", "keyword" }, { "namespace", "keyword" }, { "protected", "keyword" }, - { "enum", "keyword" } }, + { "enum", "keyword" }, { "function", "keyword" } }, "//" } ); // JSON diff --git a/src/tools/ecode/thirdparty/subprocess.h b/src/tools/ecode/thirdparty/subprocess.h index 95de639d0..696ef0908 100644 --- a/src/tools/ecode/thirdparty/subprocess.h +++ b/src/tools/ecode/thirdparty/subprocess.h @@ -767,6 +767,10 @@ int subprocess_create_ex(const char *const commandLine[], int options, } } + + +#if !defined(NO_POSIX_SPAWN) + if (environment) { #ifdef __clang__ #pragma clang diagnostic push @@ -884,7 +888,86 @@ int subprocess_create_ex(const char *const commandLine[], int options, out_process->alive = 1; posix_spawn_file_actions_destroy(&actions); + return 0; +#else + child = fork(); + + if (-1 == child) { + return -1; + } + + if (0 == child) { + // Close the stdin write end + close(stdinfd[1]); + // Map the read end to stdin + dup2(stdinfd[0], STDIN_FILENO); + + // Close the stdout read end + close(stdoutfd[0]); + // Map the write end to stdout + dup2(stdoutfd[1], STDOUT_FILENO); + + if (subprocess_option_combined_stdout_stderr == + (options & subprocess_option_combined_stdout_stderr)) { + dup2(STDOUT_FILENO, STDERR_FILENO); + } else { + // Close the stderr read end + close(stderrfd[0]); + // Map the write end to stdout + dup2(stderrfd[1], STDERR_FILENO); + } + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wcast-qual" +#pragma clang diagnostic ignored "-Wold-style-cast" +#endif + + if (environment) { + _Exit(execve(commandLine[0], (char *const *)commandLine, + (char *const *)environment)); + } else if (subprocess_option_inherit_environment != + (options & subprocess_option_inherit_environment)) { + _Exit(execve(commandLine[0], (char *const *)commandLine, + empty_environment)); + } else { + _Exit(execvp(commandLine[0], (char *const *)commandLine)); + } + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + } else { + // Close the stdin read end + close(stdinfd[0]); + // Store the stdin write end + out_process->stdin_file = fdopen(stdinfd[1], "wb"); + + // Close the stdout write end + close(stdoutfd[1]); + // Store the stdout read end + out_process->stdout_file = fdopen(stdoutfd[0], "rb"); + + if (subprocess_option_combined_stdout_stderr == + (options & subprocess_option_combined_stdout_stderr)) { + out_process->stderr_file = out_process->stdout_file; + } else { + // Close the stderr write end + close(stderrfd[1]); + // Store the stderr read end + out_process->stderr_file = fdopen(stderrfd[0], "rb"); + } + + // Store the child's pid + out_process->child = child; + + out_process->alive = 1; + + return 0; + } +#endif + #endif }