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.
This commit is contained in:
Kleis Auke Wolthuizen 2023-04-06 15:19:35 +02:00
parent 9ec6695a72
commit 86ef92d548

View File

@ -578,7 +578,9 @@ g_win32_check_windows_version (const gint major,
/* Check for Service Pack Version >= 0 */ /* Check for Service Pack Version >= 0 */
g_return_val_if_fail (spver >= 0, FALSE); 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 */ /* check the OS and Service Pack Versions */
if (osverinfo.dwMajorVersion > (DWORD) major) if (osverinfo.dwMajorVersion > (DWORD) major)