From 86ef92d548f11d01e532729748581d8fcfbad1d9 Mon Sep 17 00:00:00 2001 From: Kleis Auke Wolthuizen Date: Thu, 6 Apr 2023 15:19:35 +0200 Subject: [PATCH] gwin32: Avoid use of function call with side effect in g_return_* macro This ensures that _g_win32_call_rtl_version is always called, regardless of whether G_DISABLE_CHECKS is defined or not. --- glib/gwin32.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/glib/gwin32.c b/glib/gwin32.c index d1391b1d2..85053c079 100644 --- a/glib/gwin32.c +++ b/glib/gwin32.c @@ -578,7 +578,9 @@ g_win32_check_windows_version (const gint major, /* Check for Service Pack Version >= 0 */ g_return_val_if_fail (spver >= 0, FALSE); - g_return_val_if_fail (_g_win32_call_rtl_version (&osverinfo), FALSE); + + if (!_g_win32_call_rtl_version (&osverinfo)) + return FALSE; /* check the OS and Service Pack Versions */ if (osverinfo.dwMajorVersion > (DWORD) major)