在 2022-03-30 16:51, Martin Storsjö 写道:
+__MINGW_SELECTANY void (WINAPI *__error_handler)(HRESULT hr,IErrorInfo *perrinfo) = _com_raise_error;
+
+inline void WINAPI _set_com_error_handler(void (WINAPI *pHandler)(HRESULT
hr,IErrorInfo *perrinfo)) {
+ __error_handler = pHandler;
+}
+
+inline void WINAPI _com_issue_error(HRESULT hr) {
+ __error_handler(hr, NULL);
+}
+
Would it be better to have these things in the CRT as they are not C++, instead of having a selectany symbol in the header? I am afraid this could be auto-exported from DLLs unintentionally, in which case the name `__error_handler` is bad (`__com_error_handler` would be a better choice).
-- Best regards, LIU Hao
OpenPGP_signature
Description: OpenPGP digital signature
_______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
