Skip to content

enum: Allow configuring the sentinel variant name - #1179

Open
ChrisJr404 wants to merge 1 commit into
mozilla:mainfrom
ChrisJr404:sentinel-variant-name
Open

enum: Allow configuring the sentinel variant name#1179
ChrisJr404 wants to merge 1 commit into
mozilla:mainfrom
ChrisJr404:sentinel-variant-name

Conversation

@ChrisJr404

Copy link
Copy Markdown

Fixes #664.

The sentinel variant name was hard-coded to Sentinel. This adds a sentinel_variant_name option under [enum] (default "Sentinel", so existing output is unchanged) and a matching sentinel-variant-name annotation for per-enum overrides. With prefix_with_name you can now get names like Columns_MAX instead of Columns_Sentinel.

Added a test that covers both the config option and the annotation, plus docs and template entries.

Adds a sentinel_variant_name enum option (default "Sentinel") plus a
matching sentinel-variant-name annotation, so the variant emitted by
add_sentinel can be renamed to something like MyEnum_MAX.

Closes mozilla#664
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.

Make c-style sentinel configurable

1 participant