Modify prototype of GetSteamID. previous prototype wouldn't work correctly if compile with Visual Studio 2010, Because the SteamID is returned by register EAX and EDX instead of a auto generated hidden parameter which point to a SteamID.
Sorry, I've fixed that. Forgive my miss testing. I didn't try to build whole Open Steamworks, instead, I just utilize the interface part with a minor modification. Maybe the problem is due to that I typedef SteamID as uint64.
So the code below is legal in my project:
Checking the generated code, you will see code like this:
xor eax, eax
xor edx, edx
Actually, the correct and expected code should pass the value out by a hidden parameter which is a pointer to a SteamID instance owned by caller. MSVC will generated such parameter if return value is a class(structure). so I think my modified prototype is a little bit safer. because it doesn't reply on compiler Intrinsics.
The original is valid and conforms to the ABI, this isn't ill-defined behaviour.
Additionally, OSW is designed for calling into SteamWorks, not reimplementing, I'm fairly sure your changes will upset the compiler for our target use - not to mention GCC as well.
It would probably require some horrible compiler-specific calling convention hackery to have it work with both non-POD and POD types, although I'm fairly surprised MSVC managed to optimize it to that.