ES-DE/es-core/src/Platform.h

39 lines
894 B
C
Raw Normal View History

//
// Platform.h
//
// Platform-specific functions.
//
#pragma once
#ifndef ES_CORE_PLATFORM_H
#define ES_CORE_PLATFORM_H
2017-11-01 22:21:10 +00:00
#include <string>
// Why the hell this naming inconsistency exists is well beyond me.
#ifdef _WIN64
#define sleep Sleep
2012-09-10 18:48:00 +00:00
#endif
enum QuitMode {
QUIT = 0,
REBOOT = 1,
POWEROFF = 2
};
// Uses UTF-8 for Unix and does a UTF-16/wstring conversion for Windows.
int runSystemCommand(const std::string& cmd_utf8);
// Windows specific UTF-16/wstring function. (FOR FUTURE USE)
int runSystemCommand(const std::wstring& cmd_utf16);
int launchEmulatorUnix(const std::string& cmd_utf8);
int launchEmulatorWindows(const std::wstring& cmd_utf16);
// Clean, normal shutdown.
int quitES(QuitMode mode = QuitMode::QUIT);
// Immediately shut down the application as cleanly as possible.
void emergencyShutdown();
void processQuitMode();
#endif // ES_CORE_PLATFORM_H