Skip to content

Use a getter for accessing Config::cpp_compat#613

Merged
emilio merged 2 commits intomozilla:masterfrom
petrochenkov:cppcompat
Oct 31, 2020
Merged

Use a getter for accessing Config::cpp_compat#613
emilio merged 2 commits intomozilla:masterfrom
petrochenkov:cppcompat

Conversation

@petrochenkov
Copy link
Copy Markdown
Contributor

Extracted from #590.

Many config options only make sense when some other options have specific values (e.g. the language is C, or something like that) and should return "false" or "empty list" otherwise, as they were not set at all.
#590 is going to introduce more such getters, but a getter from cpp_compat makes sense regardless of Cython.
cpp_compat should be considered true only if the current language is C, otherwise it should be considered effectively false even if set. This PR introduces a method Config::cpp_compatible_c to solve this problem.

I didn't rename the original field cpp_compat because it's a part of the public crate interface, but ideally it would be renamed to something like cpp_compat_raw to prevent direct reads from it.

@emilio emilio merged commit 1491365 into mozilla:master Oct 31, 2020
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.

2 participants