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: | 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)
Change History (5)
by , 7 years ago
Attachment: | boost_thread_physical_concurrency_always_0.patch added |
---|
comment:1 by , 7 years ago
Milestone: | To Be Determined → Boost 1.61.0 |
---|---|
Owner: | changed from | to
Status: | new → assigned |
comment:2 by , 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 , 7 years ago
Attachment: | boost_thread_winapi_versions_not_defined.patch added |
---|
comment:3 by , 7 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Hi, thanks for catching this issue.
Please could you check on develop?
https://github.com/boostorg/thread/commit/317a735836fb77671d16df7e111fdbba22cc76a5