boostorg / system

Boost.org system module
http://boost.org/libs/system
36 stars 85 forks source link

VC2022 snprintf.hpp(60,5): : error : no member named '_vsnprintf' in namespace 'std'; did you mean simply '_vsnprintf'? #81

Closed olejniczak closed 2 years ago

olejniczak commented 2 years ago

I have this error in snprintf.hpp(60,5) using boost-locale 1.78 with MSVC 2022 (_MSC_VER == 1931)

Probably the macro in line 26 should look like this:

if ( defined(_MSC_VER) && (_MSC_VER < 1900 || _MSC_VER > 1930) ) || ( defined(MINGW32) && !defined(__MINGW64_VERSION_MAJOR) )

Flamefire commented 2 years ago

@olejniczak Please provide an example on how to reproduce this and a complete error (including the trace on how that error occured)

Also note that this is not related to Boost.Locale at all but to Boost.System (@glenfe @pdimov please move) judging by the mentioned line 26: https://github.com/boostorg/system/blob/boost-1.78.0/include/boost/system/detail/snprintf.hpp#L26

It also seems to be an invalid issue: I fail to see a valid use that can lead to "no member named '_vsnprintf' in namespace 'std'" at https://github.com/boostorg/system/blob/boost-1.78.0/include/boost/system/detail/snprintf.hpp#L60

I would assume that somewhere there is a #define vsnprintf _vsnprintf in the user code which should be removed. Hence closing this. Please reopen if that is not the case.