Opened 10 years ago

Closed 10 years ago

#6908 closed Bugs (fixed)

Compile error due to unprotected definitions of _WIN32_WINNT and WINVER

Reported by: dnave@… Owned by: viboes
Milestone: Boost 1.50.0 Component: thread
Version: Boost Development Trunk Severity: Problem
Keywords: Boost.Thread, msvc, compile error, WINVER, _WIN32_WINNT, _WIN32_IE Cc:

Description

Environment: Visual Studio 9 on Windows 7 SP1 64-bit (compiling for 32-bit)

Boost versions: at least 1.47.0, up to trunk

libs/thread/src/win32/thread.cpp defines _WIN32_WINNT and WINVER outside of #ifndef/#endif, leading to a macro redefinition that results in a compile error when _WIN32_IE is set to something other than 0x0600. Specifically, this error prevents compiling Boost.Threads when defining WINVER=_WIN32_WINNT=0x0601 for Windows 7, with _WIN32_IE=0x0700.

Suggested solutions: Unless there is some technical reason for redefining them locally, these macros should either not be defined, or should be protected by #ifndef/#endif pairs.

Attachments (1)

thread.cpp.patch (487 bytes ) - added by Demian Nave <dnave@…> 10 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 by viboes, 10 years ago

Owner: changed from Anthony Williams to viboes
Status: newassigned

I don't know why this was defined. Please could you provide a working patch protecting the definition.

by Demian Nave <dnave@…>, 10 years ago

Attachment: thread.cpp.patch added

comment:2 by viboes, 10 years ago

Milestone: To Be DeterminedBoost 1.51.0

Committed in trunk at revision 78802.

comment:3 by viboes, 10 years ago

Milestone: Boost 1.51.0Boost 1.50.0
Resolution: fixed
Status: assignedclosed

Merged to release branch.

Note: See TracTickets for help on using tickets.