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

Codechange: [OSX] Use more exact enum names where introduced with the 10.12 SDK. #9394

Merged
merged 3 commits into from Jun 22, 2021

Conversation

michicc
Copy link
Member

@michicc michicc commented Jun 21, 2021

Motivation / Problem / Description

The enum values still have the exact same numerical values, but the 10.12
SDK introduced more explicit names (e.g. like NSEventTypeApplicationDefined
instead of NSApplicationDefined) for several enum constants.
Use them when available.

The OSX 10.12 SDK introduced various more logical and exact enum/constant names for various things.
As the old variants where marked deprecated, building for newer OSX versions produces compiler warnings.

Limitations

I added #ifdefs where needed as master as of right now is still marked as 10.9 minimum. If the minimum ws bumped to 10.12, these wouldn't be needed. The pasteboard change is 10.6+.

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')

@glx22
Copy link
Contributor

glx22 commented Jun 21, 2021

Only 10 first warnings are reported in #9391 CI summary, there are more in the build log.

… 10.12 SDK.

The enum values still have the exact same numerical values, but the 10.12
SDK introduced more explicit names (e.g. like NSEventTypeApplicationDefined
instead of NSApplicationDefined) for several enum constants.
Use them when available.
Copy link
Member

@TrueBrain TrueBrain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are awesome :D Tnx for this!

@@ -12,6 +12,8 @@
#include "../../stdafx.h"
#include "../../os/macosx/macos.h"

#define GL_SILENCE_DEPRECATION
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would benefit from a comment, I think

@michicc michicc merged commit 37116a7 into OpenTTD:master Jun 22, 2021
@michicc michicc deleted the pr/osx_deprecated branch June 22, 2021 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants