boostorg / static_string

A fixed capacity dynamically sized string
http://boost.org/libs/static_string
Boost Software License 1.0
63 stars 29 forks source link

`static_wstring` should be conditionally enabled #51

Closed jwt27 closed 1 year ago

jwt27 commented 1 year ago

Hi!

static_wstring fails to compile on platforms that don't have libc support for wide-character strings. I got it to work by defining a no-op std::swprintf(...), but obviously that isn't really a solution.

However, boost::config has feature detection macros for this: BOOST_NO_CWCHAR and BOOST_NO_SWPRINTF. So ideally, static_wstring should be conditionally enabled based on those.

sdkrystian commented 1 year ago

Reasonable, I'll take care of this soon

alandefreitas commented 1 year ago

Please note this was probably because of the standalone library. We would need two paths here.

sdkrystian commented 1 year ago

@alandefreitas I'm not sure if it's worth trying to replicate BOOST_NO_CWCHAR in standalone.. Might be better to just check for cwchar in standalone?

alandefreitas commented 1 year ago

Probably not. Whatever is easier in standalone. We can have a separate path for boost.