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
merged 1 commit into from Feb 14, 2021
Merged

Conversation

@Milek7
Copy link
Contributor

@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 {
      |        ^

Description

Prefix VkMapping names with driver name.

Limitations

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
Member

@LordAro LordAro left a comment

Sure.

@glx22 glx22 merged commit 751f595 into OpenTTD:master Feb 14, 2021
9 checks passed
9 checks passed
@github-actions
Emscripten
Details
@github-actions
Commit checker
Details
@github-actions
Linux (clang, clang++)
Details
@github-actions
Linux (gcc, g++)
Details
@github-actions
Mac OS (x64, x86_64)
Details
@github-actions
Windows (windows-latest, x86)
Details
@github-actions
Windows (windows-latest, x64)
Details
@github-actions
Windows (windows-2016, x86) Windows (windows-2016, x86)
Details
@github-actions
Windows (windows-2016, x64) Windows (windows-2016, x64)
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants