mirror of
https://github.com/RPCSX/rpcsx-ui.git
synced 2026-01-31 01:05:23 +01:00
cpp: fixes for windows
This commit is contained in:
@@ -15,6 +15,7 @@ string(TOLOWER "${CMAKE_SYSTEM_NAME}" EXTENSION_TRIPLE_OS)
|
||||
|
||||
if("${EXTENSION_TRIPLE_OS}" STREQUAL "windows")
|
||||
set(EXTENSION_TRIPLE_FORMAT "pe")
|
||||
set(EXTENSION_TRIPLE_OS "win32")
|
||||
else()
|
||||
set(EXTENSION_TRIPLE_FORMAT "elf")
|
||||
endif()
|
||||
|
||||
@@ -15,10 +15,23 @@
|
||||
#include <unordered_map>
|
||||
#include <utility>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
using namespace rpcsx::ui;
|
||||
using namespace nlohmann;
|
||||
|
||||
struct StdioTransport : Transport {
|
||||
#ifdef _WIN32
|
||||
StdioTransport() {
|
||||
_setmode(_fileno(stdin), _O_BINARY);
|
||||
_setmode(_fileno(stdout), _O_BINARY);
|
||||
_setmode(_fileno(stderr), _O_BINARY);
|
||||
}
|
||||
#endif
|
||||
|
||||
void write(std::span<const std::byte> bytes) override {
|
||||
while (true) {
|
||||
auto count = std::fwrite(bytes.data(), 1, bytes.size(), stdout);
|
||||
|
||||
Reference in New Issue
Block a user