[PATCH] D42225: libcxx: Provide overloads for basic_filebuf::open() et al that take wchar_t* filenames on Windows.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 19 20:36:57 PST 2018


pcc added a comment.

In https://reviews.llvm.org/D42225#982057, @compnerd wrote:

> I'm still torn if we should enable this on not `_LIBCPP_ABI_MICROSOFT`.


It looks like mingw32 provides a declaration of `_wfopen`, so at least from a technical perspective it seems fine.

In https://reviews.llvm.org/D42225#982275, @mclow.lists wrote:

> In https://reviews.llvm.org/D42225#982057, @compnerd wrote:
>
> > Can we avoid the `_WIN32` usage please?  We spent some effort to avoid it, and have `_LIBCPP_WIN32API` to indicate that we want the Win32 API.  I know that Marshall had some strong opinions on avoiding the `_WIN32` usage, but, beyond that, I think that this is a completely reasonable thing to provide.
>
>
> I agree.  `_WIN32` is really a big hammer.  I'd much rather some more focused and descriptive guard macro. Maybe `_LIBCPP_HAS_OPEN_WITH_WCHAR`.
>
> Also, if the tests are for a libc++ extension, then they belong in the test/libcxx hierarchy.


Done.



================
Comment at: libcxx/include/fstream:560
+basic_filebuf<_CharT, _Traits>*
+basic_filebuf<_CharT, _Traits>::open(const wchar_t* __s, ios_base::openmode __mode)
+{
----------------
compnerd wrote:
> Should this also be marked `inline`?
No strong opinions, I was just being consistent with the `const char*` overload which isn't marked inline.


https://reviews.llvm.org/D42225





More information about the llvm-commits mailing list