gwin32.h: Make g_win32_clear_com() static inline

...for C++ implementations, as suggested by Luca Bacci.

Make things safer in terms of avoiding ODR violations[1].

[1]: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/4392#note_2296862
This commit is contained in:
Chun-wei Fan 2024-12-13 11:03:32 +08:00
parent a3a95c2a0b
commit 4ab7977a4d

View File

@ -181,7 +181,7 @@ G_END_DECLS
* so we need to have a C++ version for this * so we need to have a C++ version for this
*/ */
template <typename com_interface> template <typename com_interface>
inline void static inline void
g_win32_clear_com (com_interface **com_obj) g_win32_clear_com (com_interface **com_obj)
{ {
IUnknown **unknown_com_obj = reinterpret_cast<IUnknown **>(com_obj); IUnknown **unknown_com_obj = reinterpret_cast<IUnknown **>(com_obj);