Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SmileyAG
Copy link
Collaborator

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.

@SmileyAG SmileyAG added restructuring high-priority Pull request or issue that should be reviewed and merged first. labels Jul 14, 2024
Comment on lines +53 to +54
#define BXT_CONCATENATE(x, y) x##y
#define BXT_CONCATENATE_DETAIL(x, y) BXT_CONCATENATE(x, y)
Copy link
Owner

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?

Copy link
Collaborator Author

@SmileyAG SmileyAG Jul 29, 2024

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

Copy link
Owner

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?

Copy link
Collaborator Author

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.

Copy link
Owner

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

BunnymodXT/shared.hpp Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
high-priority Pull request or issue that should be reviewed and merged first. restructuring
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants