aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Tietz <kai.tietz@onevision.com>2010-12-02 13:15:10 +0000
committerKai Tietz <ktietz@gcc.gnu.org>2010-12-02 14:15:10 +0100
commit266afdd60e1f7c6429fd7a6902b4b3360f55a90a (patch)
tree65f772231a2553dee779bca49e775b496d6e941a
parent8529e24b969fa5bb0446977c8817210c115b9517 (diff)
downloadgcc-266afdd60e1f7c6429fd7a6902b4b3360f55a90a.zip
gcc-266afdd60e1f7c6429fd7a6902b4b3360f55a90a.tar.gz
gcc-266afdd60e1f7c6429fd7a6902b4b3360f55a90a.tar.bz2
re PR libstdc++/43738 (basic_file_stdio.cc uses ioctl on a fd, but not available on mingw32)
2010-12-02 Kai Tietz <kai.tietz@onevision.com> PR libstdc++/43738 * config/io/basic_file_stdio.cc (showmanyc): Check _GLIBCXX_NO_IOCTL before use of ioctl. * config/os/mingw32/os_defines.h (_GLIBCXX_NO_IOCTL): New. From-SVN: r167369
-rw-r--r--libstdc++-v3/ChangeLog7
-rw-r--r--libstdc++-v3/config/io/basic_file_stdio.cc4
-rw-r--r--libstdc++-v3/config/os/mingw32/os_defines.h5
3 files changed, 15 insertions, 1 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 933fb23..c5f6ab9 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,10 @@
+2010-12-02 Kai Tietz <kai.tietz@onevision.com>
+
+ PR libstdc++/43738
+ * config/io/basic_file_stdio.cc (showmanyc): Check _GLIBCXX_NO_IOCTL
+ before use of ioctl.
+ * config/os/mingw32/os_defines.h (_GLIBCXX_NO_IOCTL): New.
+
2010-12-01 François Dumont <francois.cppdevs@free.fr>
* testsuite/23_containers/deque/cons/2.cc: Fix to explicitely invoke
diff --git a/libstdc++-v3/config/io/basic_file_stdio.cc b/libstdc++-v3/config/io/basic_file_stdio.cc
index 472f123..d2de028 100644
--- a/libstdc++-v3/config/io/basic_file_stdio.cc
+++ b/libstdc++-v3/config/io/basic_file_stdio.cc
@@ -334,6 +334,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
streamsize
__basic_file<char>::showmanyc()
{
+#ifndef _GLIBCXX_NO_IOCTL
#ifdef FIONREAD
// Pipes and sockets.
#ifdef _GLIBCXX_FIONREAD_TAKES_OFF_T
@@ -344,7 +345,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
int __r = ioctl(this->fd(), FIONREAD, &__num);
if (!__r && __num >= 0)
return __num;
-#endif
+#endif
+#endif
#ifdef _GLIBCXX_HAVE_POLL
// Cheap test.
diff --git a/libstdc++-v3/config/os/mingw32/os_defines.h b/libstdc++-v3/config/os/mingw32/os_defines.h
index 5435ce9..22a11f5 100644
--- a/libstdc++-v3/config/os/mingw32/os_defines.h
+++ b/libstdc++-v3/config/os/mingw32/os_defines.h
@@ -60,4 +60,9 @@
// See libstdc++/37522.
#define _GLIBCXX_HAVE_BROKEN_VSWPRINTF 1
+// See libstdc++/43738
+// On native windows targets there is no ioctl function. And the existing
+// ioctlsocket function doesn't work for normal file-descriptors.
+#define _GLIBCXX_NO_IOCTL 1
+
#endif