[cmake-developers] [PATCH v4] Add MinGW support for FStream
Brad King
brad.king at kitware.com
Wed Jul 13 10:15:39 EDT 2016
On 07/12/2016 10:05 PM, Dāvis Mosāns wrote:
> std::basic_filebuf::open(const wchar_t *) isn't part of C++ standard
> and it's only present for MSVC but it isn't present in libstdc++ (MinGW)
> so we implement this functionality using GNU libstdc++ stdio_filebuf
> extension and _wfopen function.
Thanks.
> +IF(KWSYS_USE_FStream)
> + INCLUDE(CheckIncludeFileCXX)
> + CHECK_INCLUDE_FILE_CXX(ext/stdio_filebuf.h HAVE_EXT_STDIO_FILEBUF_H)
> + IF(HAVE_EXT_STDIO_FILEBUF_H)
> + add_definitions(-DHAVE_EXT_STDIO_FILEBUF_H=1)
> + ENDIF()
> +ENDIF()
Please use KWSYS_PLATFORM_CXX_TEST with kwsysPlatformTestsCXX.cxx to
do this check, and then store the result in Configure.hxx so that
KWSys clients do not have to repeat the check. See the existing
case of KWSYS_STL_HAS_WSTRING for an example. We could name the
new check KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H.
> - class basic_ifstream : public std::basic_istream<CharType,Traits>
> + class basic_efilebuf
[snip]
> +class basic_ifstream : public std::basic_istream<CharType,Traits>,
> + public basic_efilebuf<CharType,Traits>
Please split this refactoring out into a preceding commit.
Thanks,
-Brad
More information about the cmake-developers
mailing list