The problem is twofold. First, as noted in rici, C99 and C ++ 11's answer, support has been added for combining narrow string literals and wide string literals, so you don't need to extend the narrow literal by adding L. Visual C ++ does not yet support this for C or C ++.
Since the compiler does not yet support this function, we should give libraries the opportunity to explicitly extend these string literals using a technique similar to the one in your answer. Unfortunately, we have defined these macros so that they can expand to several string literals. For example, PRId32 expands to "l" "d" .
It is valid, but it does not allow you to expand, because there is no way to add L to the second string literal (to make "d" in L"d" ). I'm afraid I see no way to make this work without (re) defining macros myself.
I discovered an internal error, so that if the compiler does not add support for concatenating mixed-width literals during preprocessing in the next release, we can revise these definitions to possibly expand them explicitly.
James McNellis
source share