Opened 8 years ago

Closed 8 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

https://github.com/MythTV/mythtv/commit/89f4e32fe89d39d230ae9143b29194f1a0325c49 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 mythbuild.sh script before committing Windows specific changes. Thanks.

Attachments (1)

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

Download all attachments as: .zip

Change History (4)

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

Attachment: 11-d3d9-min.diff added

comment:1 Changed 8 years ago by stuartm

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

comment:2 Changed 8 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 8 years ago by dblain

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