[Haiku-commits] r31296 - in haiku/branches/features/32bit-wchar_t/src/system/libroot/posix/glibc: extensions libio

zooey at BerliOS zooey at mail.berlios.de
Sun Jun 28 18:38:15 CEST 2009


Author: zooey
Date: 2009-06-28 18:38:08 +0200 (Sun, 28 Jun 2009)
New Revision: 31296
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=31296&view=rev

Modified:
   haiku/branches/features/32bit-wchar_t/src/system/libroot/posix/glibc/extensions/obstack.c
   haiku/branches/features/32bit-wchar_t/src/system/libroot/posix/glibc/libio/fileops.c
   haiku/branches/features/32bit-wchar_t/src/system/libroot/posix/glibc/libio/iofwide.c
   haiku/branches/features/32bit-wchar_t/src/system/libroot/posix/glibc/libio/ioseekoff.c
   haiku/branches/features/32bit-wchar_t/src/system/libroot/posix/glibc/libio/ioseekpos.c
   haiku/branches/features/32bit-wchar_t/src/system/libroot/posix/glibc/libio/libioP.h
   haiku/branches/features/32bit-wchar_t/src/system/libroot/posix/glibc/libio/stdfiles.c
Log:
* reactivated wide-stream support again, in order to get wchar-related io
  functions working


Modified: haiku/branches/features/32bit-wchar_t/src/system/libroot/posix/glibc/extensions/obstack.c
===================================================================
--- haiku/branches/features/32bit-wchar_t/src/system/libroot/posix/glibc/extensions/obstack.c	2009-06-28 16:36:23 UTC (rev 31295)
+++ haiku/branches/features/32bit-wchar_t/src/system/libroot/posix/glibc/extensions/obstack.c	2009-06-28 16:38:08 UTC (rev 31296)
@@ -144,7 +144,7 @@
   } while (0)
 # endif
 
-
+
 /* Initialize an obstack H for use.  Specify chunk size SIZE (0 means default).
    Objects start on multiples of ALIGNMENT (0 means use default).
    CHUNKFUN is the function to use to allocate chunks,
@@ -375,7 +375,7 @@
     }
   return lp != 0;
 }
-
+
 /* Free objects in obstack H, including OBJ and everything allocate
    more recently than OBJ.  If OBJ is zero, free everything in H.  */
 
@@ -454,7 +454,7 @@
     abort ();
 }
 #endif
-
+
 int
 _obstack_memory_used (h)
      struct obstack *h;
@@ -468,7 +468,7 @@
     }
   return nbytes;
 }
-
+
 /* Define the error handler.  */
 # ifndef _
 #  if (HAVE_LIBINTL_H && ENABLE_NLS) /*|| defined _LIBC*/
@@ -500,17 +500,15 @@
      happen because the "memory exhausted" message appears in other places
      like this and the translation should be reused instead of creating
      a very similar string which requires a separate translation.  */
-#if 0
 # if defined _LIBC && defined USE_IN_LIBIO
   if (_IO_fwide (stderr, 0) > 0)
     __fwprintf (stderr, L"%s\n", _("memory exhausted"));
   else
 # endif
-#endif
     fprintf (stderr, "%s\n", _("memory exhausted"));
   exit (obstack_exit_failure);
 }
-
+
 # if 0
 /* These are now turned off because the applications do not use it
    and it uses bcopy via obstack_grow, which causes trouble on sysV.  */

Modified: haiku/branches/features/32bit-wchar_t/src/system/libroot/posix/glibc/libio/fileops.c
===================================================================
--- haiku/branches/features/32bit-wchar_t/src/system/libroot/posix/glibc/libio/fileops.c	2009-06-28 16:36:23 UTC (rev 31295)
+++ haiku/branches/features/32bit-wchar_t/src/system/libroot/posix/glibc/libio/fileops.c	2009-06-28 16:38:08 UTC (rev 31296)
@@ -180,7 +180,6 @@
       _IO_setg (fp, NULL, NULL, NULL);
       _IO_setp (fp, NULL, NULL);
     }
-#if 0
 #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
   else
     {
@@ -191,7 +190,6 @@
       _IO_wsetp (fp, NULL, NULL);
     }
 #endif
-#endif
 
   INTUSE(_IO_un_link) ((struct _IO_FILE_plus *) fp);
   fp->_flags = _IO_MAGIC|CLOSED_FILEBUF_FLAGS;

Modified: haiku/branches/features/32bit-wchar_t/src/system/libroot/posix/glibc/libio/iofwide.c
===================================================================
--- haiku/branches/features/32bit-wchar_t/src/system/libroot/posix/glibc/libio/iofwide.c	2009-06-28 16:36:23 UTC (rev 31295)
+++ haiku/branches/features/32bit-wchar_t/src/system/libroot/posix/glibc/libio/iofwide.c	2009-06-28 16:38:08 UTC (rev 31296)
@@ -42,7 +42,6 @@
 # include <shlib-compat.h>
 #endif
 
-#if 0
 /* Prototypes of libio's codecvt functions.  */
 static enum __codecvt_result do_out (struct _IO_codecvt *codecvt,
 				     __mbstate_t *statep,
@@ -87,7 +86,6 @@
   .__trans_fct = __gconv_transliterate
 };
 #endif
-#endif
 
 /* Return orientation of stream.  If mode is nonzero try to change
  * the orientation first.
@@ -119,12 +117,7 @@
 		return fp->_mode;
 	}
 
-	/* Set the orientation appropriately. */
-	if (mode > 0) {
-		// wide-orientation is currently disabled!
-		return -1;
-	}
-#if 0
+	{
 		struct _IO_codecvt *cc = fp->_codecvt = &fp->_wide_data->_codecvt;
 
 		fp->_wide_data->_IO_read_ptr = fp->_wide_data->_IO_read_end;
@@ -215,15 +208,12 @@
 	 which allows the functions without knowing the position.  */
       fp->_offset = _IO_SYSSEEK (fp, 0, _IO_seek_cur);
     }
-#endif
-
 	/* Set the mode now.  */
 	fp->_mode = mode;
 
 	return mode;
 }
 
-#if 0
 static enum __codecvt_result
 do_out (struct _IO_codecvt *codecvt, __mbstate_t *statep,
 	const wchar_t *from_start, const wchar_t *from_end,
@@ -504,4 +494,3 @@
   return MB_CUR_MAX;
 #endif
 }
-#endif

Modified: haiku/branches/features/32bit-wchar_t/src/system/libroot/posix/glibc/libio/ioseekoff.c
===================================================================
--- haiku/branches/features/32bit-wchar_t/src/system/libroot/posix/glibc/libio/ioseekoff.c	2009-06-28 16:36:23 UTC (rev 31295)
+++ haiku/branches/features/32bit-wchar_t/src/system/libroot/posix/glibc/libio/ioseekoff.c	2009-06-28 16:38:08 UTC (rev 31296)
@@ -52,11 +52,7 @@
      callback may not know to do the right thing about it.
      This may be over-kill, but it'll do for now. TODO */
   if (mode != 0 && ((_IO_fwide (fp, 0) < 0 && _IO_have_backup (fp))
-#if 0
 		    || (_IO_fwide (fp, 0) > 0 && _IO_have_wbackup (fp))))
-#else
-			))
-#endif
     {
       if (dir == _IO_seek_cur && _IO_in_backup (fp))
 	{
@@ -67,10 +63,8 @@
 	}
       if (_IO_fwide (fp, 0) < 0)
 	INTUSE(_IO_free_backup_area) (fp);
-#if 0
       else
 	INTUSE(_IO_free_wbackup_area) (fp);
-#endif
     }
 
   return _IO_SEEKOFF (fp, offset, dir, mode);

Modified: haiku/branches/features/32bit-wchar_t/src/system/libroot/posix/glibc/libio/ioseekpos.c
===================================================================
--- haiku/branches/features/32bit-wchar_t/src/system/libroot/posix/glibc/libio/ioseekpos.c	2009-06-28 16:36:23 UTC (rev 31295)
+++ haiku/branches/features/32bit-wchar_t/src/system/libroot/posix/glibc/libio/ioseekpos.c	2009-06-28 16:38:08 UTC (rev 31296)
@@ -42,10 +42,8 @@
 		if (_IO_have_backup(fp))
 			INTUSE(_IO_free_backup_area)(fp);
 	} else {
-#if 0
 		if (_IO_have_wbackup(fp))
 			INTUSE(_IO_free_wbackup_area)(fp);
-#endif
 	}
 
 	return _IO_SEEKPOS(fp, pos, mode);

Modified: haiku/branches/features/32bit-wchar_t/src/system/libroot/posix/glibc/libio/libioP.h
===================================================================
--- haiku/branches/features/32bit-wchar_t/src/system/libroot/posix/glibc/libio/libioP.h	2009-06-28 16:36:23 UTC (rev 31295)
+++ haiku/branches/features/32bit-wchar_t/src/system/libroot/posix/glibc/libio/libioP.h	2009-06-28 16:38:08 UTC (rev 31296)
@@ -482,7 +482,6 @@
 extern int _IO_old_fsetpos64 __P ((_IO_FILE *, const _IO_fpos64_t *));
 
 
-#if 0
 #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
 # define _IO_do_flush(_f) \
   ((_f)->_mode <= 0							      \
@@ -491,12 +490,11 @@
    : INTUSE(_IO_wdo_write)(_f, (_f)->_wide_data->_IO_write_base,	      \
 			   ((_f)->_wide_data->_IO_write_ptr		      \
 			    - (_f)->_wide_data->_IO_write_base)))
-#endif	// was #else
-#endif
-
+#else
 # define _IO_do_flush(_f) \
    INTUSE(_IO_do_write)(_f, (_f)->_IO_write_base,			      \
 			(_f)->_IO_write_ptr-(_f)->_IO_write_base)
+#endif
 
 #define _IO_old_do_flush(_f) \
   _IO_old_do_write(_f, (_f)->_IO_write_base, \

Modified: haiku/branches/features/32bit-wchar_t/src/system/libroot/posix/glibc/libio/stdfiles.c
===================================================================
--- haiku/branches/features/32bit-wchar_t/src/system/libroot/posix/glibc/libio/stdfiles.c	2009-06-28 16:36:23 UTC (rev 31295)
+++ haiku/branches/features/32bit-wchar_t/src/system/libroot/posix/glibc/libio/stdfiles.c	2009-06-28 16:38:08 UTC (rev 31296)
@@ -35,7 +35,7 @@
 #include "libioP.h"
 
 #ifdef _IO_MTSAFE_IO
-/*# if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
+# if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
 #  define DEF_STDFILE(NAME, FD, CHAIN, FLAGS) \
   static _IO_lock_t _IO_stdfile_##FD##_lock = _IO_lock_initializer; \
   static struct _IO_wide_data _IO_wide_data_##FD \
@@ -44,15 +44,13 @@
     = {FILEBUF_LITERAL(CHAIN, FLAGS, FD, &_IO_wide_data_##FD), \
        &INTUSE(_IO_file_jumps)};
 # else
-*/
 #  define DEF_STDFILE(NAME, FD, CHAIN, FLAGS) \
   static _IO_lock_t _IO_stdfile_##FD##_lock = _IO_lock_initializer; \
   struct _IO_FILE_plus NAME \
     = {FILEBUF_LITERAL(CHAIN, FLAGS, FD, NULL), \
        &INTUSE(_IO_file_jumps)};
-//# endif
+# endif
 #else
-/*
 # if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
 #  define DEF_STDFILE(NAME, FD, CHAIN, FLAGS) \
   static struct _IO_wide_data _IO_wide_data_##FD \
@@ -61,12 +59,11 @@
     = {FILEBUF_LITERAL(CHAIN, FLAGS, FD, &_IO_wide_data_##FD), \
        &INTUSE(_IO_file_jumps)};
 # else
-*/
 #  define DEF_STDFILE(NAME, FD, CHAIN, FLAGS) \
   struct _IO_FILE_plus NAME \
     = {FILEBUF_LITERAL(CHAIN, FLAGS, FD, NULL), \
        &INTUSE(_IO_file_jumps)};
-//# endif
+# endif
 #endif
 
 DEF_STDFILE(_IO_2_1_stdin_, 0, 0, _IO_NO_WRITES);




More information about the Haiku-commits mailing list