Closed sezero closed 2 years ago
I considered it as a workaround and not an issue of SDL code. The issue is a bit confusing (as always with any Microsoft stuff). According to the Windows.Devices.Power.idl file, the get_FullChargeCapacityInMilliwattHours
function has the parameter of type Windows.Foundation.IReference<INT32> **
. It was translated to __FIReference_1_INT32 **
type in Windows.Devices.Power.h in wine & mingw-w64. But the Microsoft Windows SDK translated it to __FIReference_1_int **
.
This seems like a reasonable patch, with appropriate documentation
If looking at windows sdk headers is not out of the question, here is someone's github repo of them: https://github.com/hughbe/windows-sdk-headers
There is also another confusion with Windows.Foundation.IReference<BYTE>**
type. It is translated to __FIReference_1_byte**
(see the different uppercase/lowercase).
By the way, I have not tested the SDL project with those new mingw-w64 headers due to absence of any gaming hardware. If anyone is willing to test the binaries compiled with mingw-w64 toolchain I can provide the necessary msys2/mingw headers & crt packages from CI.
Is it not more appropriate that the confusions are addressed in the idls and headers themselves, e.g. by proper defines?
Is it not more appropriate that the confusions are addressed in the idls
Hence my first statement, "I considered it as a workaround and not an issue of SDL code". I have asked wine developers about this issue and they will be working on this but it may take time.
Patch added, thanks!
The patch isn't really a fix, and the new wgi headers are not in any mingw-w64 releases as far as I know: Remember to revert it when things get fixed in wine and mingw-w64
Yep, will do.
Actually, if the headers aren't in any release, I'll go ahead and revert this change and report it upstream.
Okay, I put in a better fix in d2c4d74dd0302369251dce9375b49f394e54f76a
MinGW-w64 recently imported all missing headers in git so that our WGI code can be compiled against it. However it was reported to me that the following patch is needed for the time being - not sure why, yet. I am putting this info here so that it may possibly be discussed and solved by help from others.
Hint: @icculus, @slouken. CC: @Biswa96