2020-06-21 12:25:28 +00:00
|
|
|
//
|
|
|
|
// Platform.h
|
|
|
|
//
|
|
|
|
// Platform-specific functions.
|
|
|
|
//
|
|
|
|
|
2017-10-31 17:12:50 +00:00
|
|
|
#pragma once
|
|
|
|
#ifndef ES_CORE_PLATFORM_H
|
|
|
|
#define ES_CORE_PLATFORM_H
|
|
|
|
|
2017-11-01 22:21:10 +00:00
|
|
|
#include <string>
|
|
|
|
|
2020-06-21 12:25:28 +00:00
|
|
|
// Why the hell this naming inconsistency exists is well beyond me.
|
2020-07-03 18:23:51 +00:00
|
|
|
#ifdef _WIN64
|
2020-06-21 12:25:28 +00:00
|
|
|
#define sleep Sleep
|
2012-09-10 18:48:00 +00:00
|
|
|
#endif
|
2013-05-13 19:53:28 +00:00
|
|
|
|
2020-06-21 12:25:28 +00:00
|
|
|
enum QuitMode {
|
|
|
|
QUIT = 0,
|
|
|
|
REBOOT = 1,
|
|
|
|
POWEROFF = 2
|
2019-08-14 23:50:23 +00:00
|
|
|
};
|
|
|
|
|
2020-06-21 12:25:28 +00:00
|
|
|
// Run UTF-8 encoded in the shell (requires wstring conversion on Windows).
|
|
|
|
int runSystemCommand(const std::string& cmd_utf8);
|
2019-08-14 23:50:23 +00:00
|
|
|
int quitES(QuitMode mode = QuitMode::QUIT);
|
|
|
|
void processQuitMode();
|
2017-10-31 17:12:50 +00:00
|
|
|
|
|
|
|
#endif // ES_CORE_PLATFORM_H
|