[PATCH 0/1] MR4864: msvcp: Use proper operator_new and operator_delete types for msvcirt.
From: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> msvcirt's PARENTSRC imports exception.c from msvcp90, but it uses a function pointer for these functions, resulting in a type mismatch. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> --- dlls/msvcp90/msvcp90.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dlls/msvcp90/msvcp90.h b/dlls/msvcp90/msvcp90.h index 3b97cfefd4b..70b2a1ac542 100644 --- a/dlls/msvcp90/msvcp90.h +++ b/dlls/msvcp90/msvcp90.h @@ -37,8 +37,13 @@ void __cdecl _invalid_parameter_noinfo(void); BOOL __cdecl __uncaught_exception(void); int __cdecl _callnewh(size_t); +#ifdef _MSVCIRT +extern void* (__cdecl *operator_new)(SIZE_T); +extern void (__cdecl *operator_delete)(void*); +#else void* __cdecl operator_new(size_t); void __cdecl operator_delete(void*); +#endif extern void* (__cdecl *MSVCRT_set_new_handler)(void*); #if _MSVCP_VER >= 110 -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/4864
There's already similar problem for `_MSVCP_VER < 140` case that was solved differently. I think it's better to change msvcirt code in the same way. Both for consistency and so msvcp90.h doesn't contain any msvcirt specific code. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/4864#note_57971
On Thu Jan 18 18:13:05 2024 +0000, Piotr Caban wrote:
There's already similar problem for `_MSVCP_VER < 140` case that was solved differently. I think it's better to change msvcirt code in the same way. Both for consistency and so msvcp90.h doesn't contain any msvcirt specific code. Sorry, I'm not familiar with these modules at all, can you please elaborate what I have to change?
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/4864#note_57975
On Thu Jan 18 18:13:04 2024 +0000, Gabriel Ivăncescu wrote:
Sorry, I'm not familiar with these modules at all, can you please elaborate what I have to change? Take a look on `operator_new` and `operator_delete` functions in dlls/msvcp90/msvcp_main.c. It's a simple wrapper that calls `MSVCRT_operator_new` function.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/4864#note_57981
participants (2)
-
Gabriel Ivăncescu -
Piotr Caban (@piotr)