boostorg / endian

Boost Endian library
46 stars 49 forks source link

'endian': ambiguous symbol #33

Closed Eddie-cz closed 5 years ago

Eddie-cz commented 5 years ago

Recent commit in buffers.hpp omitted to fully qualify namespace resulting in ambiguous symbol error when including boost::spirit headers too. Suggested fix: use boost::endian:: everywhere instead of endian::. Environment: Windows 10, msvc15, boost 1.7.0 beta1 RC3. How to reproduce:

include <boost/spirit/include/qi.hpp>

include <boost/endian/arithmetic.hpp>

struct record { boost::endian::big_int16_t type;

record(boost::int16_t t)
{
    type = t;       
}

};

pdimov commented 5 years ago

Should be fixed now, although the test doesn't pass on master because of

C:\projects\boost-root\boost/endian/buffers.hpp(60) : warning C4005: 'BOOST_ENDIAN_DEFAULT_CONSTRUCT' : macro redefinition
C:\projects\boost-root\boost/spirit/home/support/detail/endian/endian.hpp(55) : see previous definition of 'BOOST_ENDIAN_DEFAULT_CONSTRUCT'

and warnings-as-errors=on.