Use __VA_OPT__(, ) __VA_ARGS__ instead of ##__VA_ARGS__
#11008
Merged
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.
Per https://en.cppreference.com/w/cpp/preprocessor/replace#.23_and_.23.23_operators the
##behavior is a nonstandard extension; this extension seems to be supported by all compilers we care about, but IntelliSense in visual studio doesn't correctly handle it, resulting in false errors in the IDE (but not when compiling).Per https://en.cppreference.com/w/cpp/preprocessor/replace#Function-like_macros C++20 introduced a workaround, where
__VA_OPT__(, )generates a comma if and only if__VA_ARGS__is non-empty.This PR replaces all occurrences, with the exception of Externals, DSPSpy (which is not likely to be edited in MSVC and does not target C++20 currently), and JitArm64_Integer.cpp (which uses
Function(__VA_ARGS__), and thus does not ever need a comma):dolphin/Source/Core/Core/PowerPC/JitArm64/JitArm64_Integer.cpp
Lines 21 to 28 in 299aef9
Supersedes #9936.