about summary refs log tree commit diff
path: root/libio
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2005-12-19 12:11:38 +0000
committerJakub Jelinek <jakub@redhat.com>2005-12-19 12:11:38 +0000
commit2c6cfe6853a30deb4af842aacc924fa298d0521a (patch)
tree7fcc409e499bb8e3d96522f7fc2393fc10e53db2 /libio
parent3ccb96cd41b38d0159bdf8aad229c3599864c65d (diff)
downloadglibc-2c6cfe6853a30deb4af842aacc924fa298d0521a.tar.gz
glibc-2c6cfe6853a30deb4af842aacc924fa298d0521a.tar.xz
glibc-2c6cfe6853a30deb4af842aacc924fa298d0521a.zip
Updated to fedora-glibc-20051219T1003 cvs/fedora-glibc-2_3_90-19
Diffstat (limited to 'libio')
-rw-r--r--libio/iofwide.c43
-rw-r--r--libio/libc_fatal.c31
-rw-r--r--libio/libioP.h4
3 files changed, 67 insertions, 11 deletions
diff --git a/libio/iofwide.c b/libio/iofwide.c
index 7af9a633f8..a9936687dd 100644
--- a/libio/iofwide.c
+++ b/libio/iofwide.c
@@ -40,6 +40,7 @@
 # include <wcsmbs/wcsmbsload.h>
 # include <iconv/gconv_int.h>
 # include <shlib-compat.h>
+# include <sysdep.h>
 #endif
 
 
@@ -68,7 +69,7 @@ static int do_always_noconv (struct _IO_codecvt *codecvt);
 
 
 /* The functions used in `codecvt' for libio are always the same.  */
-struct _IO_codecvt __libio_codecvt =
+const struct _IO_codecvt __libio_codecvt =
 {
   .__codecvt_destr = NULL,		/* Destructor, never used.  */
   .__codecvt_do_out = do_out,
@@ -82,7 +83,7 @@ struct _IO_codecvt __libio_codecvt =
 
 
 #ifdef _LIBC
-struct __gconv_trans_data __libio_translit attribute_hidden =
+const struct __gconv_trans_data __libio_translit attribute_hidden =
 {
   .__trans_fct = __gconv_transliterate
 };
@@ -126,12 +127,11 @@ _IO_fwide (fp, mode)
 	 selected locale for LC_CTYPE.  */
 #ifdef _LIBC
       {
-	struct gconv_fcts fcts;
-
 	/* Clear the state.  We start all over again.  */
 	memset (&fp->_wide_data->_IO_state, '\0', sizeof (__mbstate_t));
 	memset (&fp->_wide_data->_IO_last_state, '\0', sizeof (__mbstate_t));
 
+	struct gconv_fcts fcts;
 	__wcsmbs_clone_conv (&fcts);
 	assert (fcts.towc_nsteps == 1);
 	assert (fcts.tomb_nsteps == 1);
@@ -159,7 +159,8 @@ _IO_fwide (fp, mode)
 	cc->__cd_out.__cd.__data[0].__statep = &fp->_wide_data->_IO_state;
 
 	/* And now the transliteration.  */
-	cc->__cd_out.__cd.__data[0].__trans = &__libio_translit;
+	cc->__cd_out.__cd.__data[0].__trans
+	  = (struct __gconv_trans_data  *) &__libio_translit;
       }
 #else
 # ifdef _GLIBCPP_USE_WCHAR_T
@@ -232,7 +233,13 @@ do_out (struct _IO_codecvt *codecvt, __mbstate_t *statep,
   codecvt->__cd_out.__cd.__data[0].__outbufend = (unsigned char *) to_end;
   codecvt->__cd_out.__cd.__data[0].__statep = statep;
 
-  status = DL_CALL_FCT (gs->__fct,
+  __gconv_fct fct = gs->__fct;
+#ifdef PTR_DEMANGLE
+  if (gs->__shlib_handle != NULL)
+    PTR_DEMANGLE (fct);
+#endif
+
+  status = DL_CALL_FCT (fct,
 			(gs, codecvt->__cd_out.__cd.__data, &from_start_copy,
 			 (const unsigned char *) from_end, NULL,
 			 &dummy, 0, 0));
@@ -298,7 +305,13 @@ do_unshift (struct _IO_codecvt *codecvt, __mbstate_t *statep,
   codecvt->__cd_out.__cd.__data[0].__outbufend = (unsigned char *) to_end;
   codecvt->__cd_out.__cd.__data[0].__statep = statep;
 
-  status = DL_CALL_FCT (gs->__fct,
+  __gconv_fct fct = gs->__fct;
+#ifdef PTR_DEMANGLE
+  if (gs->__shlib_handle != NULL)
+    PTR_DEMANGLE (fct);
+#endif
+
+  status = DL_CALL_FCT (fct,
 			(gs, codecvt->__cd_out.__cd.__data, NULL, NULL,
 			 NULL, &dummy, 1, 0));
 
@@ -361,7 +374,13 @@ do_in (struct _IO_codecvt *codecvt, __mbstate_t *statep,
   codecvt->__cd_in.__cd.__data[0].__outbufend = (unsigned char *) to_end;
   codecvt->__cd_in.__cd.__data[0].__statep = statep;
 
-  status = DL_CALL_FCT (gs->__fct,
+  __gconv_fct fct = gs->__fct;
+#ifdef PTR_DEMANGLE
+  if (gs->__shlib_handle != NULL)
+    PTR_DEMANGLE (fct);
+#endif
+
+  status = DL_CALL_FCT (fct,
 			(gs, codecvt->__cd_in.__cd.__data, &from_start_copy,
 			 (const unsigned char *) from_end, NULL,
 			 &dummy, 0, 0));
@@ -459,7 +478,13 @@ do_length (struct _IO_codecvt *codecvt, __mbstate_t *statep,
   codecvt->__cd_in.__cd.__data[0].__outbufend = (unsigned char *) &to_buf[max];
   codecvt->__cd_in.__cd.__data[0].__statep = statep;
 
-  status = DL_CALL_FCT (gs->__fct,
+  __gconv_fct fct = gs->__fct;
+#ifdef PTR_DEMANGLE
+  if (gs->__shlib_handle != NULL)
+    PTR_DEMANGLE (fct);
+#endif
+
+  status = DL_CALL_FCT (fct,
 			(gs, codecvt->__cd_in.__cd.__data, &cp,
 			 (const unsigned char *) from_end, NULL,
 			 &dummy, 0, 0));
diff --git a/libio/libc_fatal.c b/libio/libc_fatal.c
new file mode 100644
index 0000000000..be23849829
--- /dev/null
+++ b/libio/libc_fatal.c
@@ -0,0 +1,31 @@
+/* Copyright (C) 1993, 1995, 1997, 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <stdio.h>
+
+/* Abort with an error message.  */
+void
+__libc_fatal (message)
+     const char *message;
+{
+  /* This function should write MESSAGE out in the most reliable way.
+     It is called in situations like internal stdio lossage.  */
+
+  abort ();
+}
+libc_hidden_def (__libc_fatal)
diff --git a/libio/libioP.h b/libio/libioP.h
index 319b0fd5f3..be3b38a2e4 100644
--- a/libio/libioP.h
+++ b/libio/libioP.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1997-2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1997-2003, 2004, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -469,7 +469,7 @@ extern const struct _IO_jump_t _IO_streambuf_jumps;
 extern const struct _IO_jump_t _IO_old_proc_jumps attribute_hidden;
 extern const struct _IO_jump_t _IO_str_jumps attribute_hidden;
 extern const struct _IO_jump_t _IO_wstr_jumps attribute_hidden;
-extern struct _IO_codecvt __libio_codecvt attribute_hidden;
+extern const struct _IO_codecvt __libio_codecvt attribute_hidden;
 extern int _IO_do_write (_IO_FILE *, const char *, _IO_size_t) __THROW;
 extern int _IO_new_do_write (_IO_FILE *, const char *, _IO_size_t) __THROW;
 extern int _IO_old_do_write (_IO_FILE *, const char *, _IO_size_t) __THROW;