From d920a86e25b8997e54dc1c17e091acd3182f1952 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Wed, 19 Feb 2025 20:34:19 +0800 Subject: [PATCH] gwin32.h: Avoid including unknwn.h It pulls in windows.h causing conflict for code that assume windows.h is not previously included. Thanks to Luca Bacci for proposing this fix, and @Osyotr for pointing out this issue! Fixes issue #3613. --- glib/gwin32.h | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/glib/gwin32.h b/glib/gwin32.h index 182d23fcd..5397ef6b4 100644 --- a/glib/gwin32.h +++ b/glib/gwin32.h @@ -43,11 +43,6 @@ G_BEGIN_DECLS #ifdef G_OS_WIN32 -/* needed include for C++ builds; including this in C mode will cause havoc of type conflicts */ -#ifdef __cplusplus -#include -#endif - /* * To get prototypes for the following POSIXish functions, you have to * include the indicated non-POSIX headers. The functions are defined @@ -184,12 +179,10 @@ template static inline void g_win32_clear_com (com_interface **com_obj) { - IUnknown **unknown_com_obj = reinterpret_cast(com_obj); - - if (*unknown_com_obj != NULL) + if (*com_obj != NULL) { - (*unknown_com_obj)->Release (); - *unknown_com_obj = NULL; + (*com_obj)->Release (); + *com_obj = NULL; } } #endif