Why does it expand to BOOST_VERSION_NUMBER_AVAILABLE?
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start by tracing how BOOST_OS_UNIX and other Boost.Predef macros expand to BOOST_VERSION_NUMBER_AVAILABLE, then compare that behavior with the shown BOOST_PP_IF use case. Determine whether the intended outcome is separate 1/0 macros such as BOOST_OS_UNIX10 or changing the existing macros, and validate the chosen behavior with relevant preprocessor usage.
Written by the indexing model from the issue text.
Description
Boost.Predef macros (e.g. BOOST_OS_WINDOWS) expand to BOOST_VERSION_NUMBER_AVAILABLE instead of 1 or 0. Why is that?
By expanding to BOOST_VERSION_NUMBER_AVAILABLE I can't use these macros in Boost.PP. For instance, I recently had to use code like:
BOOST_PP_IF(
BOOST_OS_UNIX,
lua_pushcfunction(L, tcp_socket_assign),
lua_pushcfunction(L, throw_enosys));
But it failed to compile because BOOST_OS_UNIX doesn't expand to 1 or 0. Instead, it expands to a complex expression that can't be used in preprocessor metaprogramming.
Could we offer BOOST_OS_UNIX10 (and the equivalent to other macros as well) that expand to 1 or 0 instead of a complex expression? Or, alternatively, modify these macros to expand to 1 or 0 already?
- Dominant language
- C
- Stars
- 56
- Forks
- 87
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from boostorg/predef
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 62/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
-
Difficulty 3/5 1-2 days Newbie friendliness 52/100
-
unique endian macros Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
bug enhancement
Similar issues
-
level/task module/gcp type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100
hapostgres/pg_auto_failover#1190 ·
-
docs
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
P3 sonic-vpp
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
sonic-net/sonic-buildimage#29662 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 94/100
spack/spack-packages#6586 ·