From 5b0636cf0d5f61cb96fa775acd8ba213ce19e15a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Mon, 4 Sep 2017 23:16:27 +0200 Subject: [PATCH] Adapt Linux UiContext to Emscripten --- src/openrct2-ui/UiContext.Linux.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/openrct2-ui/UiContext.Linux.cpp b/src/openrct2-ui/UiContext.Linux.cpp index 7a61b49af8..1d61b002d6 100644 --- a/src/openrct2-ui/UiContext.Linux.cpp +++ b/src/openrct2-ui/UiContext.Linux.cpp @@ -14,7 +14,7 @@ *****************************************************************************/ #pragma endregion -#if (defined(__linux__) || defined(__OpenBSD__) || defined(__FreeBSD__)) && !defined(__ANDROID__) +#if (defined(__linux__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__EMSCRIPTEN__)) && !defined(__ANDROID__) #include #include @@ -240,6 +240,7 @@ namespace OpenRCT2 { namespace Ui static sint32 Execute(const std::string &command, std::string * output = nullptr) { +#ifndef __EMSCRIPTEN__ log_verbose("executing \"%s\"...\n", command.c_str()); FILE * fpipe = popen(command.c_str(), "r"); if (fpipe == nullptr) @@ -282,6 +283,10 @@ namespace OpenRCT2 { namespace Ui // Return exit code return pclose(fpipe); +#else + log_warning("Emscripten cannot execute processes. The commandline was '%s'.", command.c_str()); + return -1; +#endif // __EMSCRIPTEN__ } static std::string GetKDialogFilterString(const std::vector filters)