Make sure certain variables used only on some platforms are defined only on said platforms

This commit is contained in:
Alexander Babikov
2022-04-14 06:48:25 +05:00
parent 4d18efd825
commit 484a082122
2 changed files with 10 additions and 0 deletions

View File

@@ -404,7 +404,9 @@ pc_init(int argc, char *argv[])
time_t now;
int c;
int ng = 0, lvmp = 0;
#ifdef _WIN32
uint32_t *uid, *shwnd;
#endif
uint32_t lang_init = 0;
/* Grab the executable's full path. */

View File

@@ -625,6 +625,7 @@ void MainWindow::on_actionSettings_triggered() {
plat_pause(currentPause);
}
#if defined(__unix__) && !defined(__HAIKU__)
std::array<uint32_t, 256> x11_to_xt_base
{
0,
@@ -952,7 +953,9 @@ std::array<uint32_t, 256> x11_to_xt_vnc
0x14B,
0x14D,
};
#endif
#ifdef Q_OS_MACOS
std::array<uint32_t, 256> darwin_to_xt
{
0x1E,
@@ -1084,7 +1087,9 @@ std::array<uint32_t, 256> darwin_to_xt
0x148,
0,
};
#endif
#if defined(__unix__) && !defined(__HAIKU__)
static std::unordered_map<uint32_t, uint16_t> evdev_to_xt =
{
{96, 0x11C},
@@ -1104,6 +1109,7 @@ static std::unordered_map<uint32_t, uint16_t> evdev_to_xt =
{110, 0x152},
{111, 0x153}
};
#endif
#ifdef __HAIKU__
static std::unordered_map<uint8_t, uint16_t> be_to_xt =
@@ -1216,7 +1222,9 @@ static std::unordered_map<uint8_t, uint16_t> be_to_xt =
};
#endif
#if defined(__unix__) && !defined(__HAIKU__)
static std::array<uint32_t, 256>& selected_keycode = x11_to_xt_base;
#endif
uint16_t x11_keycode_to_keysym(uint32_t keycode)
{