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));
                ^
This commit is contained in:
rofl0r 2024-12-06 02:11:49 +00:00
parent 7c2659314f
commit ee6d8aa125
1 changed files with 11 additions and 11 deletions

View File

@ -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;