boostorg / mpl

Boost.org mpl module
http://boost.org/libs/mpl
Boost Software License 1.0
52 stars 78 forks source link

Do not check the birand/bitor macros in cplusplus mode #57

Open ABBAPOH opened 3 years ago

ABBAPOH commented 3 years ago

Some 3rdparty parsers (e.g. Qt moc) fail to parse the bitand.hpp due to the fact that bitand is a keyword in C++, not a macro. Modern MSVC versions define bitand/bitor only if __cplusplus macro is not defined, see iso646.h: https://pastebin.com/zTcd0juT

Thus, boost can also check the macro only in C mode making moc happy

ABBAPOH commented 3 years ago

See also: https://bugreports.qt.io/projects/QBS/issues/QBS-1632

jeking3 commented 2 years ago

@ABBAPOH please rebase on develop to run all tests - thanks.

ABBAPOH commented 2 years ago

@jeking3 Sorry for the delay, I missed your comment.

Is it OK btw that the first check is only checks #if defined(_MSC_VER) but the second also checks clang #if defined(_MSC_VER) && !defined(__clang__) ?