Skip to content

Commit 1e38e7e

Browse files
committed
Fix Linux build
Windows build untested, but should be unaffected
1 parent 5bc7533 commit 1e38e7e

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/OSOutput.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,37 @@
11
#include "OSOutput.h"
22

3-
#include <codecvt>
43
#include <string>
54

5+
#ifdef _WIN32
6+
#include <codecvt>
7+
68
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
79
#include <windows.h>
810
#include <stringapiset.h>
911
#include <WinUser.h>
1012
#undef WIN32_LEAN_AND_MEAN
13+
#endif
1114

1215
OSOutput::OSOutput(){}
1316

1417
OSOutput::~OSOutput(){}
1518

1619
void OSOutput::deleteCharacter()
1720
{
21+
#ifdef _WIN32
1822
INPUT fakekey[2];
1923
fakekey[0].type = fakekey[1].type = INPUT_KEYBOARD;
2024
fakekey[0].ki.wVk = fakekey[1].ki.wVk = VK_BACK;
2125
fakekey[0].ki.time = fakekey[1].ki.time = 0;
2226
fakekey[1].ki.dwFlags = KEYEVENTF_KEYUP;
2327

2428
SendInput(2, fakekey, sizeof(INPUT));
29+
#endif
2530
}
2631

2732
void OSOutput::outputCharacter(const std::string &sText)
2833
{
34+
#ifdef _WIN32
2935
INPUT fakekey[2];
3036
if(sText[0] == '\r' && sText[1] == '\n') {
3137
// Newline, so we want to fake an enter
@@ -51,4 +57,5 @@ void OSOutput::outputCharacter(const std::string &sText)
5157

5258
delete[] wstr;
5359
}
60+
#endif
5461
}

src/OSOutput.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#pragma once
2-
#include <xstring>
2+
#include <string>
33

44

55
class OSOutput

0 commit comments

Comments
 (0)