asio config.hpp macro redefinition - mistake?
In file boost_1_59_0\boost\asio\detail\config.hpp line 227 gives a macro redefinition warning. // Compliant C++11 compilers put noexcept specifiers on error_category members. #if !defined(BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT) # if (BOOST_VERSION >= 105300) # define BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT BOOST_NOEXCEPT # elif defined(__clang__) # if __has_feature(__cxx_noexcept__) # define BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT noexcept(true) # endif // __has_feature(__cxx_noexcept__) # elif defined(__GNUC__) # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) # if defined(__GXX_EXPERIMENTAL_CXX0X__) # define BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT noexcept(true) # endif // defined(__GXX_EXPERIMENTAL_CXX0X__) # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) # endif // defined(__GNUC__) # if defined(BOOST_ASIO_MSVC) # if (_MSC_VER >= 1900) # define BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT noexcept(true) // ****** here ****** # endif // (_MSC_VER >= 1900) # endif // defined(BOOST_ASIO_MSVC) # if !defined(BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT) # define BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT # endif // !defined(BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT) #endif // !defined(BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT) To paraphrase, the block reads # if (BOOST_VERSION >= 105300) // it is: 105900 >= 105300 *# define BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT BOOST_NOEXCEPT* ⋮ # if defined(BOOST_ASIO_MSVC) # if (_MSC_VER >= 1900) *# define BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT noexcept(true)* # endif // (_MSC_VER >= 1900) # endif // defined(BOOST_ASIO_MSVC) It seems that this is missing a guard or has the if/else things mixed up.
On 13/01/2016 12:32, John M. Dlugosz wrote:
In file boost_1_59_0\boost\asio\detail\config.hpp line 227 gives a macro redefinition warning. [...] # endif // defined(__GNUC__) # if defined(BOOST_ASIO_MSVC)
It looks like you could probably workaround this by merging these two lines into a single #elif. It's probably worthwhile reporting this on the ASIO mailing list, as I think the maintainer is more active there than here.
participants (2)
-
Gavin Lambert
-
John M. Dlugosz