Modify

Opened 5 years ago

Closed 5 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@…> 5 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 Changed 5 years ago by viboes

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.

Changed 5 years ago by Demian Nave <dnave@…>

Attachment: thread.cpp.patch added

comment:2 Changed 5 years ago by viboes

Milestone: To Be DeterminedBoost 1.51.0

Committed in trunk at revision 78802.

comment:3 Changed 5 years ago by viboes

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

Merged to release branch.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain viboes.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.