This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: std::stoi and std::to_string on MinGW
- From: Kai Tietz <ktietz70 at googlemail dot com>
- To: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- Cc: "libstdc++" <libstdc++ at gcc dot gnu dot org>, Kai Tietz <ktietz70 at gmail dot com>
- Date: Mon, 22 Dec 2014 16:02:09 +0100
- Subject: Re: std::stoi and std::to_string on MinGW
- Authentication-results: sourceware.org; auth=none
- References: <CAH6eHdTtpO0s1jPusNaw+=Wp0wOR9qEwtDg6j6WYM53sb_OD6g at mail dot gmail dot com>
2014-12-20 3:28 GMT+01:00 Jonathan Wakely <jwakely.gcc@gmail.com>:
> People keep hitting the problem that std::stoi and std::to_string are
> not defined when using MinGW, because of the fix for
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37522
>
> If the problem is only with vswprintf then couldn't we enable
> everything except std::to_wstring?
>
> That would solve the problem for most people, as std::to_string and
> all the std::sto* functions would be defined, we'd only be missing
> std::to_wstring which I never see anyone trying to use anyway.
So patch is ok. AFAICS it affects just MinGW.org based build of libstdc++, as
_GLIBCXX_HAVE_BROKEN_VSWPRINTF is just defined in this case. For
mingw targets using mingw-w64 based build this change has no affect
due it provides none-broken w-scanf/printf C99 API,
Patch is ok.
Thanks,
Kai
PS: By mingw-w64 users the wide-character API is actually used.