在 2024-08-28 19:27, Martin Storsjö 写道:
I wouldn't maybe go out and adding separate __imp_ symbols for exactly everything, if there are many symbols where we're missing it, if there's no specific use case for it. That the user could declare it themselves with a dllimport attribute isn't strictly a case I think we need to support (overall, our import libraries are meant to be used together with our headers), but for a single case like this one I don't mind.

While reading this patch, I was wondering if our existing UCRT _onexit -> _crt_atexit function was unused and could be removed now, but it seems to me that other CRT libraries export an _onexit function anyway, so I guess it makes sense to keep it, just for keeping the CRT library interface uniform.

My point is that, if MSVCRT.DLL does export `atexit` then it's a reason to keep the `__imp_` symbol; otherwise `dllimport` could change the behavior of a program.

Technically `atexit(foo)` should have the same effect as `__cxa_atexit(foo, NULL, __dso_handle)` and is not meant to be imported.


--
Best regards,
LIU Hao

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to