Opened 7 years ago

Closed 7 years ago

#12036 closed Bugs (fixed)

boost::physical_concurrency always returns 0 if BOOST_USE_WINAPI_VERSION is not defined

Reported by: Diego Barrios Romero <eldruin@…> Owned by: viboes
Milestone: Boost 1.61.0 Component: thread
Version: Boost Development Trunk Severity: Problem
Keywords: Cc:

Description

On Windows 7: Per default BOOST_USE_WINAPI_VERSION is not defined. Nevertheless, its value is compared to BOOST_WINAPI_VERSION_WINXP (see link). As a consequence, boost:physical_concurrency() always returns 0 and the test test_physical_concurrency_is_non_zero fails.

It appears to me that BOOST_USE_WINAPI_VERSION should be already be defined here as it is used already in many other headers but somehow, it appears not to be. The proof is that applying the patch attached, the test passes. Maybe this is indicating some header inclusion issue.

(This issue is present in the current "develop" branch, as well as in the 1.60 release)

Attachments (2)

boost_thread_physical_concurrency_always_0.patch (689 bytes ) - added by Diego Barrios Romero <eldruin@…> 7 years ago.
boost_thread_winapi_versions_not_defined.patch (753 bytes ) - added by Diego Barrios Romero <eldruin@…> 7 years ago.

Download all attachments as: .zip

Change History (5)

by Diego Barrios Romero <eldruin@…>, 7 years ago

comment:1 by viboes, 7 years ago

Milestone: To Be DeterminedBoost 1.61.0
Owner: changed from Anthony Williams to viboes
Status: newassigned

Hi, thanks for catching this issue.

Please could you check on develop?

https://github.com/boostorg/thread/commit/317a735836fb77671d16df7e111fdbba22cc76a5

comment:2 by Diego Barrios Romero <eldruin@…>, 7 years ago

Hi, your solution does solve the test.

However, I still fear a header include problem. The variables BOOST_WINAPI_VERSION_WINXP, etc. are not defined either. These are defined in detail/winapi/config.hpp but this file does not appear to be included. Even if the user specified a winapi version via define, there would be no value to compare to.

The proof is that the test passes if applying the patch boost_thread_winapi_versions_not_defined.patch attached.

by Diego Barrios Romero <eldruin@…>, 7 years ago

comment:3 by viboes, 7 years ago

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