-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[RFC] options: convert some guarded options to new warning mechanism #14624
Open
Dudemanguy
wants to merge
2
commits into
mpv-player:master
Choose a base branch
from
Dudemanguy:not-available-options
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
It makes sense to only descend into the subdirectory meson build file on windows, but we should always make sure HAVE_WIN32_SMTC is 0 for other platforms. Otherwise, it gets unneccesarily awkward to work with.
Dudemanguy
force-pushed
the
not-available-options
branch
from
August 1, 2024 22:52
c48c610
to
0559d7b
Compare
Download the artifacts for this pull request: |
kasper93
reviewed
Aug 2, 2024
kasper93
reviewed
Aug 2, 2024
kasper93
reviewed
Aug 2, 2024
Dudemanguy
force-pushed
the
not-available-options
branch
from
August 3, 2024 14:12
0559d7b
to
29d5ad8
Compare
kasper93
reviewed
Aug 3, 2024
mpv has an internal inconsistency where some options are guarded at compile time and others are not. One advantage of guarding certain options is that it prevents users from using something that can't possibly work (e.g. windows-specific options on a linux machine). However, this hurts the portability of mpv config files and means it's possible for configs to break depending on a machine. This is not so nice. Attempt to have our cake and eat it too by introducing a new not_available boolean which can optionally be set when defining options. Naturally, you just set this to the negation of the preprocessor that applies. Instead of doing a hard error, mpv will print out a generic warning message that you are trying to use an option that cannot ever work with the binary. As a downside of this new approach, a bunch of windows-specific defines have to be explicitly handled which is ugly.
Dudemanguy
force-pushed
the
not-available-options
branch
from
August 3, 2024 15:32
29d5ad8
to
31812a9
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Here's my attempt at implementing what I suggested in #14618 (comment). The mechanism works fine. I implemented both per option and for sub options.