summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormilek7 <me@milek7.pl>2021-02-14 14:06:19 +0100
committerLoïc Guilloux <glx22@users.noreply.github.com>2021-02-14 23:19:50 +0100
commit751f595bb674192f22d6d091bf68ad263b120c35 (patch)
tree9cc8de8864bc2e909a127834bf8fc8af5cde9c7c
parent5a1fa185094dbcb563ba2b4ed5530995be374b19 (diff)
downloadopenttd-751f595bb674192f22d6d091bf68ad263b120c35.tar.xz
Fix: VkMapping declarations violated C++ ODR rule.
-rw-r--r--src/video/allegro_v.cpp6
-rw-r--r--src/video/cocoa/cocoa_keys.h4
-rw-r--r--src/video/cocoa/cocoa_wnd.mm2
-rw-r--r--src/video/sdl2_v.cpp8
-rw-r--r--src/video/sdl_v.cpp6
-rw-r--r--src/video/win32_v.cpp6
6 files changed, 16 insertions, 16 deletions
diff --git a/src/video/allegro_v.cpp b/src/video/allegro_v.cpp
index c3df6c650..b62486a98 100644
--- a/src/video/allegro_v.cpp
+++ b/src/video/allegro_v.cpp
@@ -235,7 +235,7 @@ bool VideoDriver_Allegro::ClaimMousePointer()
return true;
}
-struct VkMapping {
+struct AllegroVkMapping {
uint16 vk_from;
byte vk_count;
byte map_to;
@@ -244,7 +244,7 @@ struct VkMapping {
#define AS(x, z) {x, 0, z}
#define AM(x, y, z, w) {x, y - x, z}
-static const VkMapping _vk_mapping[] = {
+static const AllegroVkMapping _vk_mapping[] = {
/* Pageup stuff + up/down */
AM(KEY_PGUP, KEY_PGDN, WKC_PAGEUP, WKC_PAGEDOWN),
AS(KEY_UP, WKC_UP),
@@ -302,7 +302,7 @@ static uint32 ConvertAllegroKeyIntoMy(WChar *character)
int scancode;
int unicode = ureadkey(&scancode);
- const VkMapping *map;
+ const AllegroVkMapping *map;
uint key = 0;
for (map = _vk_mapping; map != endof(_vk_mapping); ++map) {
diff --git a/src/video/cocoa/cocoa_keys.h b/src/video/cocoa/cocoa_keys.h
index e09fe3c8a..dff4f881a 100644
--- a/src/video/cocoa/cocoa_keys.h
+++ b/src/video/cocoa/cocoa_keys.h
@@ -132,14 +132,14 @@
#define QZ_IBOOK_UP 0x3E
-struct VkMapping {
+struct CocoaVkMapping {
unsigned short vk_from;
byte map_to;
};
#define AS(x, z) {x, z}
-static const VkMapping _vk_mapping[] = {
+static const CocoaVkMapping _vk_mapping[] = {
AS(QZ_BACKQUOTE, WKC_BACKQUOTE), // key left of '1'
AS(QZ_BACKQUOTE2, WKC_BACKQUOTE), // some keyboards have it on another scancode
diff --git a/src/video/cocoa/cocoa_wnd.mm b/src/video/cocoa/cocoa_wnd.mm
index 30fa3969b..78e942c92 100644
--- a/src/video/cocoa/cocoa_wnd.mm
+++ b/src/video/cocoa/cocoa_wnd.mm
@@ -673,7 +673,7 @@ void CocoaDialog(const char *title, const char *message, const char *buttonLabel
BOOL interpret_keys = YES;
if (down) {
/* Map keycode to OTTD code. */
- auto vk = std::find_if(std::begin(_vk_mapping), std::end(_vk_mapping), [=](const VkMapping &m) { return m.vk_from == keycode; });
+ auto vk = std::find_if(std::begin(_vk_mapping), std::end(_vk_mapping), [=](const CocoaVkMapping &m) { return m.vk_from == keycode; });
uint32 pressed_key = vk != std::end(_vk_mapping) ? vk->map_to : 0;
if (modifiers & NSShiftKeyMask) pressed_key |= WKC_SHIFT;
diff --git a/src/video/sdl2_v.cpp b/src/video/sdl2_v.cpp
index 6beeeac5c..14a8bfd1c 100644
--- a/src/video/sdl2_v.cpp
+++ b/src/video/sdl2_v.cpp
@@ -401,7 +401,7 @@ void VideoDriver_SDL::EditBoxLostFocus()
}
-struct VkMapping {
+struct SDLVkMapping {
SDL_Keycode vk_from;
byte vk_count;
byte map_to;
@@ -413,7 +413,7 @@ struct VkMapping {
#define AS_UP(x, z) {x, 0, z, true}
#define AM_UP(x, y, z, w) {x, (byte)(y - x), z, true}
-static const VkMapping _vk_mapping[] = {
+static const SDLVkMapping _vk_mapping[] = {
/* Pageup stuff + up/down */
AS_UP(SDLK_PAGEUP, WKC_PAGEUP),
AS_UP(SDLK_PAGEDOWN, WKC_PAGEDOWN),
@@ -468,7 +468,7 @@ static const VkMapping _vk_mapping[] = {
static uint ConvertSdlKeyIntoMy(SDL_Keysym *sym, WChar *character)
{
- const VkMapping *map;
+ const SDLVkMapping *map;
uint key = 0;
bool unprintable = false;
@@ -508,7 +508,7 @@ static uint ConvertSdlKeyIntoMy(SDL_Keysym *sym, WChar *character)
*/
static uint ConvertSdlKeycodeIntoMy(SDL_Keycode kc)
{
- const VkMapping *map;
+ const SDLVkMapping *map;
uint key = 0;
for (map = _vk_mapping; map != endof(_vk_mapping); ++map) {
diff --git a/src/video/sdl_v.cpp b/src/video/sdl_v.cpp
index 56068fe44..f67d46801 100644
--- a/src/video/sdl_v.cpp
+++ b/src/video/sdl_v.cpp
@@ -403,7 +403,7 @@ bool VideoDriver_SDL::ClaimMousePointer()
return true;
}
-struct VkMapping {
+struct SDLVkMapping {
#if SDL_VERSION_ATLEAST(1, 3, 0)
SDL_Keycode vk_from;
#else
@@ -416,7 +416,7 @@ struct VkMapping {
#define AS(x, z) {x, 0, z}
#define AM(x, y, z, w) {x, (byte)(y - x), z}
-static const VkMapping _vk_mapping[] = {
+static const SDLVkMapping _vk_mapping[] = {
/* Pageup stuff + up/down */
AM(SDLK_PAGEUP, SDLK_PAGEDOWN, WKC_PAGEUP, WKC_PAGEDOWN),
AS(SDLK_UP, WKC_UP),
@@ -470,7 +470,7 @@ static const VkMapping _vk_mapping[] = {
static uint ConvertSdlKeyIntoMy(SDL_keysym *sym, WChar *character)
{
- const VkMapping *map;
+ const SDLVkMapping *map;
uint key = 0;
for (map = _vk_mapping; map != endof(_vk_mapping); ++map) {
diff --git a/src/video/win32_v.cpp b/src/video/win32_v.cpp
index 68e6572ba..8ccdd803e 100644
--- a/src/video/win32_v.cpp
+++ b/src/video/win32_v.cpp
@@ -114,7 +114,7 @@ bool VideoDriver_Win32::ClaimMousePointer()
return true;
}
-struct VkMapping {
+struct Win32VkMapping {
byte vk_from;
byte vk_count;
byte map_to;
@@ -123,7 +123,7 @@ struct VkMapping {
#define AS(x, z) {x, 0, z}
#define AM(x, y, z, w) {x, y - x, z}
-static const VkMapping _vk_mapping[] = {
+static const Win32VkMapping _vk_mapping[] = {
/* Pageup stuff + up/down */
AM(VK_PRIOR, VK_DOWN, WKC_PAGEUP, WKC_DOWN),
/* Map letters & digits */
@@ -166,7 +166,7 @@ static const VkMapping _vk_mapping[] = {
static uint MapWindowsKey(uint sym)
{
- const VkMapping *map;
+ const Win32VkMapping *map;
uint key = 0;
for (map = _vk_mapping; map != endof(_vk_mapping); ++map) {