Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: VkMapping declarations violated C++ ODR rule. #8674

merged 1 commit into from Feb 14, 2021


Copy link

@Milek7 Milek7 commented Feb 14, 2021

Motivation / Problem

[100%] Linking CXX executable openttd
/home/milek7/OpenTTD/src/video/allegro_v.cpp:238:8: warning: type ‘struct VkMapping’ violates the C++ One Definition Rule [-Wodr]
  238 | struct VkMapping {
      |        ^
/home/milek7/OpenTTD/src/video/sdl2_v.cpp:404:8: note: a different type is defined in another translation unit
  404 | struct VkMapping {
      |        ^
/home/milek7/OpenTTD/src/video/allegro_v.cpp:239:16: note: the first difference of corresponding definitions is field ‘vk_from’
  239 |         uint16 vk_from;
      |                ^
/home/milek7/OpenTTD/src/video/sdl2_v.cpp:405:21: note: a field of same name but different type is defined in another translation unit
  405 |         SDL_Keycode vk_from;
      |                     ^
/home/milek7/OpenTTD/src/video/allegro_v.cpp:238:8: note: type ‘uint16’ should match type ‘SDL_Keycode’
  238 | struct VkMapping {
      |        ^


Prefix VkMapping names with driver name.


Checklist for review

Some things are not automated, and forgotten often. This list is a reminder for the reviewers.

  • The bug fix is important enough to be backported? (label: 'backport requested')
  • This PR affects the save game format? (label 'savegame upgrade')
  • This PR affects the GS/AI API? (label 'needs review: Script API')
    • ai_changelog.hpp, gs_changelog.hpp need updating.
    • The compatibility wrappers (compat_*.nut) need updating.
  • This PR affects the NewGRF API? (label 'needs review: NewGRF')

Copy link

@LordAro LordAro left a comment


@glx22 glx22 merged commit 751f595 into OpenTTD:master Feb 14, 2021
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

3 participants