Fixed warning C4204: nonstandard extension used: non-constant aggregate initializer when built with Visual Studio 2019

This commit is contained in:
Sam Lantinga
2024-02-07 13:16:35 -08:00
parent 1269590dfc
commit faeb2b1f22
6 changed files with 35 additions and 30 deletions

View File

@@ -966,11 +966,11 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
if (IS_HIGH_SURROGATE(wParam)) {
data->high_surrogate = (WCHAR)wParam;
} else {
WCHAR utf16[] = {
data->high_surrogate ? data->high_surrogate : (WCHAR)wParam,
data->high_surrogate ? (WCHAR)wParam : L'\0',
L'\0'
};
WCHAR utf16[3];
utf16[0] = data->high_surrogate ? data->high_surrogate : (WCHAR)wParam;
utf16[1] = data->high_surrogate ? (WCHAR)wParam : L'\0';
utf16[2] = L'\0';
char utf8[5];
int result = WIN_WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, utf16, -1, utf8, sizeof(utf8), NULL, NULL);

View File

@@ -719,7 +719,11 @@ int WIN_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_PropertiesI
We can use (-1, -1, 0, 0) boundary to make sure no pixels are being blurred
*/
HRGN rgn = CreateRectRgn(-1, -1, 0, 0);
DWM_BLURBEHIND bb = {DWM_BB_ENABLE | DWM_BB_BLURREGION, TRUE, rgn, FALSE};
DWM_BLURBEHIND bb;
bb.flags = (DWM_BB_ENABLE | DWM_BB_BLURREGION);
bb.enable = TRUE;
bb.blur_region = rgn;
bb.transition_on_maxed = FALSE;
DwmEnableBlurBehindWindowFunc(hwnd, &bb);
DeleteObject(rgn);
}