bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 4/4] Add support for Haiku.


From: Bruno Haible
Subject: Re: [PATCH 4/4] Add support for Haiku.
Date: Mon, 10 Nov 2008 03:32:36 +0100
User-agent: KMail/1.5.4

Ingo Weinhold wrote:
> Use the glibc 1 implementation in Haiku too. Haiku actually uses a newer
> glibc version, but the libio interface has been butchered to be binary
> compatible with the glibc 1 used by BeOS.

And apparently some macros, like _IO_ferror_unlocked, that were present in
BeOS, have been removed in Haiku. Hoping that this butchering does not
continue, I'll be applying this:

2008-11-10  Bruno Haible  <address@hidden>

        Add support for Haiku.
        * lib/fbufmode.c (fbufmode): Test a symbol that is not only defined on
        glibc and BeOS, but also on Haiku.
        * lib/fpurge.c (fpurge): Likewise.
        * lib/freadable.c (freadable): Likewise.
        * lib/freadahead.c (freadahead): Likewise.
        * lib/freading.c (freading): Likewise.
        * lib/freadptr.c (freadptr): Likewise.
        * lib/freadseek.c (freadptrinc): Likewise.
        * lib/fseeko.c (rpl_fseeko): Likewise.
        * lib/fseterr.c (fseterr): Likewise.
        * lib/fwritable.c (fwritable): Likewise.
        * lib/fwriting.c (fwriting): Likewise.
        Reported by Ingo Weinhold <address@hidden>.

--- lib/fbufmode.c.orig 2008-11-10 03:25:54.000000000 +0100
+++ lib/fbufmode.c      2008-11-10 03:24:49.000000000 +0100
@@ -31,7 +31,7 @@
   /* Most systems provide FILE as a struct and the necessary bitmask in
      <stdio.h>, because they need it for implementing getc() and putc() as
      fast macros.  */
-#if defined _IO_ferror_unlocked || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, 
Linux libc5 */
+#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, 
Linux libc5 */
 # if HAVE___FLBF                    /* glibc >= 2.2 */
   if (__flbf (fp))
     return _IOLBF;
--- lib/fpurge.c.orig   2008-11-10 03:25:55.000000000 +0100
+++ lib/fpurge.c        2008-11-10 03:24:53.000000000 +0100
@@ -61,7 +61,7 @@
   /* Most systems provide FILE as a struct and the necessary bitmask in
      <stdio.h>, because they need it for implementing getc() and putc() as
      fast macros.  */
-# if defined _IO_ferror_unlocked || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, 
Linux libc5 */
+# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, 
Haiku, Linux libc5 */
   fp->_IO_read_end = fp->_IO_read_ptr;
   fp->_IO_write_ptr = fp->_IO_write_base;
   /* Avoid memory leak when there is an active ungetc buffer.  */
--- lib/freadable.c.orig        2008-11-10 03:25:55.000000000 +0100
+++ lib/freadable.c     2008-11-10 03:24:57.000000000 +0100
@@ -27,7 +27,7 @@
   /* Most systems provide FILE as a struct and the necessary bitmask in
      <stdio.h>, because they need it for implementing getc() and putc() as
      fast macros.  */
-#if defined _IO_ferror_unlocked || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, 
Linux libc5 */
+#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, 
Linux libc5 */
   return (fp->_flags & _IO_NO_READS) == 0;
 #elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, 
DragonFly, MacOS X, Cygwin */
   return (fp_->_flags & (__SRW | __SRD)) != 0;
--- lib/freadahead.c.orig       2008-11-10 03:25:55.000000000 +0100
+++ lib/freadahead.c    2008-11-10 03:25:00.000000000 +0100
@@ -25,7 +25,7 @@
 size_t
 freadahead (FILE *fp)
 {
-#if defined _IO_ferror_unlocked || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, 
Linux libc5 */
+#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, 
Linux libc5 */
   if (fp->_IO_write_ptr > fp->_IO_write_base)
     return 0;
   return (fp->_IO_read_end - fp->_IO_read_ptr)
--- lib/freading.c.orig 2008-11-10 03:25:55.000000000 +0100
+++ lib/freading.c      2008-11-10 03:25:03.000000000 +0100
@@ -31,7 +31,7 @@
   /* Most systems provide FILE as a struct and the necessary bitmask in
      <stdio.h>, because they need it for implementing getc() and putc() as
      fast macros.  */
-#if defined _IO_ferror_unlocked || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, 
Linux libc5 */
+#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, 
Linux libc5 */
   return ((fp->_flags & _IO_NO_WRITES) != 0
          || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
              && fp->_IO_read_base != NULL));
--- lib/freadptr.c.orig 2008-11-10 03:25:55.000000000 +0100
+++ lib/freadptr.c      2008-11-10 03:25:06.000000000 +0100
@@ -29,7 +29,7 @@
   size_t size;
 
   /* Keep this code in sync with freadahead!  */
-#if defined _IO_ferror_unlocked || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, 
Linux libc5 */
+#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, 
Linux libc5 */
   if (fp->_IO_write_ptr > fp->_IO_write_base)
     return NULL;
   size = fp->_IO_read_end - fp->_IO_read_ptr;
--- lib/freadseek.c.orig        2008-11-10 03:25:55.000000000 +0100
+++ lib/freadseek.c     2008-11-10 03:25:11.000000000 +0100
@@ -34,7 +34,7 @@
 freadptrinc (FILE *fp, size_t increment)
 {
   /* Keep this code in sync with freadptr!  */
-#if defined _IO_ferror_unlocked || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, 
Linux libc5 */
+#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, 
Linux libc5 */
   fp->_IO_read_ptr += increment;
 #elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, 
DragonFly, MacOS X, Cygwin */
   fp_->_p += increment;
--- lib/fseeko.c.orig   2008-11-10 03:25:55.000000000 +0100
+++ lib/fseeko.c        2008-11-10 03:25:14.000000000 +0100
@@ -41,7 +41,7 @@
 #endif
 
   /* These tests are based on fpurge.c.  */
-#if defined _IO_ferror_unlocked || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, 
Linux libc5 */
+#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, 
Linux libc5 */
   if (fp->_IO_read_end == fp->_IO_read_ptr
       && fp->_IO_write_ptr == fp->_IO_write_base
       && fp->_IO_save_base == NULL)
--- lib/fseterr.c.orig  2008-11-10 03:25:55.000000000 +0100
+++ lib/fseterr.c       2008-11-10 03:25:17.000000000 +0100
@@ -29,7 +29,7 @@
   /* Most systems provide FILE as a struct and the necessary bitmask in
      <stdio.h>, because they need it for implementing getc() and putc() as
      fast macros.  */
-#if defined _IO_ferror_unlocked || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, 
Linux libc5 */
+#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, 
Linux libc5 */
   fp->_flags |= _IO_ERR_SEEN;
 #elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, 
DragonFly, MacOS X, Cygwin */
   fp_->_flags |= __SERR;
--- lib/fwritable.c.orig        2008-11-10 03:25:55.000000000 +0100
+++ lib/fwritable.c     2008-11-10 03:25:21.000000000 +0100
@@ -27,7 +27,7 @@
   /* Most systems provide FILE as a struct and the necessary bitmask in
      <stdio.h>, because they need it for implementing getc() and putc() as
      fast macros.  */
-#if defined _IO_ferror_unlocked || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, 
Linux libc5 */
+#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, 
Linux libc5 */
   return (fp->_flags & _IO_NO_WRITES) == 0;
 #elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, 
DragonFly, MacOS X, Cygwin */
   return (fp_->_flags & (__SRW | __SWR)) != 0;
--- lib/fwriting.c.orig 2008-11-10 03:25:55.000000000 +0100
+++ lib/fwriting.c      2008-11-10 03:25:24.000000000 +0100
@@ -27,7 +27,7 @@
   /* Most systems provide FILE as a struct and the necessary bitmask in
      <stdio.h>, because they need it for implementing getc() and putc() as
      fast macros.  */
-#if defined _IO_ferror_unlocked || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, 
Linux libc5 */
+#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, 
Linux libc5 */
   return (fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) != 0;
 #elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, 
DragonFly, MacOS X, Cygwin */
   return (fp_->_flags & __SWR) != 0;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]