-
Notifications
You must be signed in to change notification settings - Fork 38
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
restructuring: added macros for stringification #533
base: master
Are you sure you want to change the base?
Conversation
#define BXT_CONCATENATE(x, y) x##y | ||
#define BXT_CONCATENATE_DETAIL(x, y) BXT_CONCATENATE(x, y) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe just BXT_CONCAT()? Also what does "DETAIL" mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does "DETAIL" mean?
#define test RTY
BXT_TOSTRING(BXT_CONCATENATE(QWE, test)) // "QWEtest" string
BXT_TOSTRING(BXT_CONCATENATE_DETAIL(QWE, test)) // "QWERTY" string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah but what does the word "DETAIL" have to do with this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What else should it be called then? BXT_CONCATENATE_EXPAND
?
Both of these macros are valuable in different situations, so I didn't add the _
prefix like I did with _BXT_STRINGIFY
, which emphasized that it was just a helper macro for another macro, but that's not the case here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like EXPAND better yeah
Most common
CONCAT
,TOSTRING
and__func__
macros, but wrapped in their own cover for increased compatibility and avoidance of unnecessary collisions.Necessary for future pull requests to making bizzare macros in modules to simplify coding in them.