From ee6d8aa12588dde17a08425a21cc37b818093523 Mon Sep 17 00:00:00 2001 From: rofl0r Date: Fri, 6 Dec 2024 02:11:49 +0000 Subject: [PATCH] replay: fix use of anonymous struct members this apparently is an extension of MSVC, and gcc disallows it. replay.cpp: In function 'INT_PTR RecordDialogProc(HWND, UINT, WPARAM, LPARAM)': replay.cpp:285:4: error: anonymous struct not inside named type }; ^ In file included from /opt/mingw-w64/libexec/i686-w64-mingw32/include/minwindef.h:163:0, from /opt/mingw-w64/libexec/i686-w64-mingw32/include/windef.h:, from /opt/mingw-w64/libexec/i686-w64-mingw32/include/windows.h:69, from replay.cpp:20: replay.cpp:286:16: error: 'rtcMin' was not declared in this scope ZeroMemory(&rtcMin, sizeof(SYSTEMTIME)); ^ replay.cpp:287:16: error: 'rtcMax' was not declared in this scope ZeroMemory(&rtcMax, sizeof(SYSTEMTIME)); ^ --- desmume/src/frontend/windows/replay.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/desmume/src/frontend/windows/replay.cpp b/desmume/src/frontend/windows/replay.cpp index a328aec1e..addd2404a 100644 --- a/desmume/src/frontend/windows/replay.cpp +++ b/desmume/src/frontend/windows/replay.cpp @@ -280,19 +280,19 @@ static INT_PTR CALLBACK RecordDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, DateTime_SetSystemtime(GetDlgItem(hwndDlg, IDC_DTP_TIME), GDT_VALID, &systime); union { - struct { SYSTEMTIME rtcMin, rtcMax; }; + struct { SYSTEMTIME rtcMin, rtcMax; } mm; SYSTEMTIME rtcMinMax[2]; }; - ZeroMemory(&rtcMin, sizeof(SYSTEMTIME)); - ZeroMemory(&rtcMax, sizeof(SYSTEMTIME)); - rtcMin.wYear = 2000; - rtcMin.wMonth = 1; - rtcMin.wDay = 1; - rtcMin.wDayOfWeek = 6; - rtcMax.wYear = 2099; - rtcMax.wMonth = 12; - rtcMax.wDay = 31; - rtcMax.wDayOfWeek = 4; + ZeroMemory(&mm.rtcMin, sizeof(SYSTEMTIME)); + ZeroMemory(&mm.rtcMax, sizeof(SYSTEMTIME)); + mm.rtcMin.wYear = 2000; + mm.rtcMin.wMonth = 1; + mm.rtcMin.wDay = 1; + mm.rtcMin.wDayOfWeek = 6; + mm.rtcMax.wYear = 2099; + mm.rtcMax.wMonth = 12; + mm.rtcMax.wDay = 31; + mm.rtcMax.wDayOfWeek = 4; DateTime_SetRange(GetDlgItem(hwndDlg, IDC_DTP_DATE), GDTR_MIN, &rtcMinMax); DateTime_SetRange(GetDlgItem(hwndDlg, IDC_DTP_DATE), GDTR_MAX, &rtcMinMax); return false;