Opened 3 years ago

Closed 3 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:


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@…> 3 years ago.
boost_thread_winapi_versions_not_defined.patch (753 bytes) - added by Diego Barrios Romero <eldruin@…> 3 years ago.

Download all attachments as: .zip

Change History (5)

Changed 3 years ago by Diego Barrios Romero <eldruin@…>

comment:1 Changed 3 years ago by viboes

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?

comment:2 Changed 3 years ago by Diego Barrios Romero <eldruin@…>

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.

Changed 3 years ago by Diego Barrios Romero <eldruin@…>

comment:3 Changed 3 years ago by viboes

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