mirror of https://github.com/OpenRCT2/OpenRCT2.git
Adapt Linux UiContext to Emscripten
This commit is contained in:
parent
0fe18149ee
commit
5b0636cf0d
|
@ -14,7 +14,7 @@
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
|
|
||||||
#if (defined(__linux__) || defined(__OpenBSD__) || defined(__FreeBSD__)) && !defined(__ANDROID__)
|
#if (defined(__linux__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__EMSCRIPTEN__)) && !defined(__ANDROID__)
|
||||||
|
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
@ -240,6 +240,7 @@ namespace OpenRCT2 { namespace Ui
|
||||||
|
|
||||||
static sint32 Execute(const std::string &command, std::string * output = nullptr)
|
static sint32 Execute(const std::string &command, std::string * output = nullptr)
|
||||||
{
|
{
|
||||||
|
#ifndef __EMSCRIPTEN__
|
||||||
log_verbose("executing \"%s\"...\n", command.c_str());
|
log_verbose("executing \"%s\"...\n", command.c_str());
|
||||||
FILE * fpipe = popen(command.c_str(), "r");
|
FILE * fpipe = popen(command.c_str(), "r");
|
||||||
if (fpipe == nullptr)
|
if (fpipe == nullptr)
|
||||||
|
@ -282,6 +283,10 @@ namespace OpenRCT2 { namespace Ui
|
||||||
|
|
||||||
// Return exit code
|
// Return exit code
|
||||||
return pclose(fpipe);
|
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<FileDialogDesc::Filter> filters)
|
static std::string GetKDialogFilterString(const std::vector<FileDialogDesc::Filter> filters)
|
||||||
|
|
Loading…
Reference in New Issue