libstdc++: Override BUFSIZ for Windows targets [PR 94268]
authorJonathan Wakely <jwakely@redhat.com>
Wed, 28 Oct 2020 13:19:21 +0000 (13:19 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Wed, 28 Oct 2020 13:19:21 +0000 (13:19 +0000)
commit0bc199fc5d4eef5a20ced20df892e5e3b8821b60
tree4a5bf3d02e15c7ce9eed8cec5ca87fd79d1a980a
parent2acb33103c4cbc6766d8707ad58aa5cc9a804719
libstdc++: Override BUFSIZ for Windows targets [PR 94268]

This replaces uses of BUFSIZ with a new _GLIBCXX_BUFSIZ macro that can
be overridden in target-specific config headers.

That allows the mingw and mingw-w64 targets to override it, because
BUFSIZ is apparently defined to 512, resulting in poor performance. The
MSVCRT stdio apparently uses 4096, so we use that too.

libstdc++-v3/ChangeLog:

PR libstdc++/94268
* config/os/mingw32-w64/os_defines.h (_GLIBCXX_BUFSIZ):
Define.
* config/os/mingw32/os_defines.h (_GLIBCXX_BUFSIZ):
Define.
* include/bits/fstream.tcc: Use _GLIBCXX_BUFSIZ instead
of BUFSIZ.
* include/ext/stdio_filebuf.h: Likewise.
* include/std/fstream (_GLIBCXX_BUFSIZ): Define.
libstdc++-v3/config/os/mingw32-w64/os_defines.h
libstdc++-v3/config/os/mingw32/os_defines.h
libstdc++-v3/include/bits/fstream.tcc
libstdc++-v3/include/ext/stdio_filebuf.h
libstdc++-v3/include/std/fstream