Use the __COUNTER__ macro instead of __LINE__#14
Open
aedrax wants to merge 1 commit intonaasking:masterfrom
Open
Use the __COUNTER__ macro instead of __LINE__#14aedrax wants to merge 1 commit intonaasking:masterfrom
aedrax wants to merge 1 commit intonaasking:masterfrom
Conversation
This fixes the issue where a compiler puts multiple case statements on the same line and then has a conflict between the two
Owner
|
Hmm, I like the idea but don't like that it's not standard. I created async.h for use on my microcontroller projects that come with their own C compilers. Then again, not really a big deal to run the gcc/clang preprocessor and then the C compiler on the preprocessed source, so I'll have to think about this... |
|
What about a fallback using something like... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes the issue where a compiler puts multiple case statements on the same line and then has a conflict between the two.
For example, for whatever reason, somebody wanted to put
They wouldn't be able to because it would expand into
but this will (effectively) expand into:
For what it's worth,
__COUNTER__is not in the C standard but is in most compilers