Opened 9 years ago

Closed 9 years ago

#9611 closed Patch - Bug Fix (Fixed)

commit 89f4e32 (changes for MSVC) breaks the Windows build

Reported by: Lawrence Rust <lvr@…> Owned by: dblain
Priority: critical Milestone: 0.25
Component: Ports - Windows Version: Master Head
Severity: medium Keywords: Windows std::min
Cc: Ticket locked: no

Description removes the namespace qualifier from std::min in mythrender_d3d9.cpp which breaks the Windows build with Mingw.

The attached patch includes <algorithm>, which defines std::min, and allows mythrender_d3d9.cpp to compile for both gcc and msvc.

NN this error indicate that the Windows builds should be defining WIN32_LEAN_AND_MEAN and NOMINMAX before #including <windows.h>. The min and max macros defined in windows.h are dangerous when mixed with C++ STL and should be removed. The gcc C++ headers such as <iterator> specifically undef min & max to avoid these problems.

P.S. Please could David Blain test his Windows changes with the Windows packager or script before committing Windows specific changes. Thanks.

Attachments (1)

11-d3d9-min.diff (366 bytes) - added by Lawrence Rust <lvr@…> 9 years ago.

Download all attachments as: .zip

Change History (4)

Changed 9 years ago by Lawrence Rust <lvr@…>

Attachment: 11-d3d9-min.diff added

comment:1 Changed 9 years ago by stuartm

Milestone: unknown0.25
Owner: changed from Nigel to dblain
Priority: minorcritical
Status: newassigned

comment:2 Changed 9 years ago by stuartm

Summary: [PATHCH] commit 89f4e32 (changes for MSVC) breaks the Windows buildcommit 89f4e32 (changes for MSVC) breaks the Windows build

comment:3 Changed 9 years ago by dblain

Resolution: Fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.