discord-rpc
discord-rpc copied to clipboard
Broken vsnwprintf()
https://github.com/discordapp/discord-rpc/blob/c59fd6df20c6904ab39f026e87af1dd90fcac7ff/src/discord_register_win.cpp#L10
Including this headerfile "cwchar" on compiler MinGW-w64-i686-5.3.0-win32-dwarf will break vsnwprintf(). Including wchar.h instead of it will fix this issue.
Sure, we can do that. As long as it doesn't break other stuff. If you'd like to PR that, it'd be very helpful!
I'm curious why exactly does it break and how come including the other header fixes that? Can you provide relevant error message and header contents?
I have no idea why it behaves like it does. I can only see the symptoms. The main symptom is: wchar_t protocolName = L"discord-4353453"; StringCbPrintfW(keyName, sizeof(keyName), L"Software\Classes\%s", protocolName);
Will result in the following output string: "Software\Classes\d" %s is truncate to first character.
What side effect including wchar.h instead of cwchar for other compilers have is beyond my knowledge