From fd646ae53717df342497a66d01db45a49f3d703d Mon Sep 17 00:00:00 2001 From: Anton Bachin Date: Mon, 19 Oct 2020 08:33:38 +0300 Subject: [PATCH] Document BETTER_ENUMS_CLASS_ATTRIBUTE Follow-on to #80. [skip ci] --- doc/OptInFeatures.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/doc/OptInFeatures.md b/doc/OptInFeatures.md index d89a491..d2aa3c4 100644 --- a/doc/OptInFeatures.md +++ b/doc/OptInFeatures.md @@ -88,3 +88,15 @@ Here they are: %% description = Optional Better Enums features, disabled by default for performance or compatibility reasons. + +### Injecting tokens + +You can define `BETTER_ENUMS_CLASS_ATTRIBUTE` before declaring a Better Enum, to +inject tokens into the class declaration. For example, in + + #define BETTER_ENUMS_CLASS_ATTRIBUTE __attribute__(foo) + BETTER_ENUM(Channel, int, Red, Green, Blue) + +The resulting enum declaration will begin with + + class __attribute__(foo) Channel {