summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinNoGUI/MainNoGUI.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/DolphinNoGUI/MainNoGUI.cpp')
-rw-r--r--Source/Core/DolphinNoGUI/MainNoGUI.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/Source/Core/DolphinNoGUI/MainNoGUI.cpp b/Source/Core/DolphinNoGUI/MainNoGUI.cpp
index 8c27992201..14fac966c9 100644
--- a/Source/Core/DolphinNoGUI/MainNoGUI.cpp
+++ b/Source/Core/DolphinNoGUI/MainNoGUI.cpp
@@ -12,8 +12,11 @@
#include <string>
#ifndef _WIN32
#include <unistd.h>
+#else
+#include <Windows.h>
#endif
+#include "Common/StringUtil.h"
#include "Core/Analytics.h"
#include "Core/Boot/Boot.h"
#include "Core/BootManager.h"
@@ -121,6 +124,11 @@ static std::unique_ptr<Platform> GetPlatform(const optparse::Values& options)
return Platform::CreateFBDevPlatform();
#endif
+#ifdef _WIN32
+ if (platform_name == "win32" || platform_name.empty())
+ return Platform::CreateWin32Platform();
+#endif
+
if (platform_name == "headless" || platform_name.empty())
return Platform::CreateHeadlessPlatform();
@@ -143,6 +151,10 @@ int main(int argc, char* argv[])
,
"x11"
#endif
+#ifdef _WIN32
+ ,
+ "win32"
+#endif
});
optparse::Values& options = CommandLineParse::ParseArguments(parser.get(), argc, argv);
@@ -198,6 +210,10 @@ int main(int argc, char* argv[])
s_platform->Stop();
});
+#ifdef _WIN32
+ signal(SIGINT, signal_handler);
+ signal(SIGTERM, signal_handler);
+#else
// Shut down cleanly on SIGINT and SIGTERM
struct sigaction sa;
sa.sa_handler = signal_handler;
@@ -205,6 +221,7 @@ int main(int argc, char* argv[])
sa.sa_flags = SA_RESETHAND;
sigaction(SIGINT, &sa, nullptr);
sigaction(SIGTERM, &sa, nullptr);
+#endif
DolphinAnalytics::Instance().ReportDolphinStart("nogui");