On Wed Nov 30 17:41:13 2022 +0000, Piotr Caban wrote:
I've finally found time to review it properly. Sorry for the delay. The patch needs lots of cleanup - starting from separating it into multiple patches (preferably adding one function in every patch) and changing commit message to describe what the patch implements (instead of what application it fixes). Taking in account next comments, I would suggest picking one function first and sending more patches after it gets in. I'm worried about adding the stubs (instead of full implementation). The functions are returning reference to object that can never be NULL on Windows. I'm expecting it to crash if application tries to use returned object. On the implementation note, I've done some initial testing of _Cout_func. It looks like it's almost compatible with msvcr80. The only difference I have found is that it uses __clrcall calling convention for virtual functions. I haven't found documentation for it but it seems to be similar to __fastcall (it additionally allows lazy compilation on function call but it can be probably ignored). Anyway I think that the way to go is to either copy implementation from msvcp and change relevant calling conventions or try to use PARENTSRC (I'm not sure if it will work well without trying).
Thanks Piotr for detailed analysis. I have found following information about `__clrcall`:
https://learn.microsoft.com/en-us/cpp/cpp/clrcall?view=msvc-140
Unfortunately I don't know how `__clrcall` could be implemented