Add support for Haiku.
authorBruno Haible <bruno@clisp.org>
Mon, 10 Nov 2008 11:37:32 +0000 (12:37 +0100)
committerBruno Haible <bruno@clisp.org>
Mon, 10 Nov 2008 11:37:32 +0000 (12:37 +0100)
12 files changed:
ChangeLog
lib/fbufmode.c
lib/fpurge.c
lib/freadable.c
lib/freadahead.c
lib/freading.c
lib/freadptr.c
lib/freadseek.c
lib/fseeko.c
lib/fseterr.c
lib/fwritable.c
lib/fwriting.c

index bb653945dde5011950cf768b5135c46d9279a0ba..5b88d5ba5d98cdf59dc1c3b89714e6c472cb59bb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,24 @@
+2008-11-10  Bruno Haible  <bruno@clisp.org>
+
+       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 <ingo_weinhold@gmx.de>.
+
+2008-11-10  Ingo Weinhold  <ingo_weinhold@gmx.de>
+
+       * lib/config.charset: Treat Haiku like BeOS.
+
 2008-11-10  Ingo Weinhold  <ingo_weinhold@gmx.de>
 
        * lib/binary-io.h (O_BINARY, O_TEXT): Treat Haiku like BeOS.
index 961ae2adb2e1cf81433f3a1ac928add13675458c..d5b456ff0a4374ee9ba12a024b33784ccd8a2e57 100644 (file)
@@ -31,7 +31,7 @@ fbufmode (FILE *fp)
   /* 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;
index c82d8012e78b9cfc78270b47628726ee163ac79b..eccfa0ea1f5a7d7a2bcf4e395c98bd006cfaaed6 100644 (file)
@@ -61,7 +61,7 @@ fpurge (FILE *fp)
   /* 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.  */
index 54703da40702fafa1317cba7b4a3a56e35818d3d..b50140433a5354499281658224f338d57a165b46 100644 (file)
@@ -27,7 +27,7 @@ freadable (FILE *fp)
   /* 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;
index 2dcf81c3054127683a4bd8ba3389837115fa84b7..25bfc1ee817a5e3be53056c06ec1b024a7bbd91c 100644 (file)
@@ -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)
index e201b8975226fb2714420905db1a37a3dd8eab12..b08fbeaf3c1c170ee188a41c0980b00cc30743fd 100644 (file)
@@ -31,7 +31,7 @@ freading (FILE *fp)
   /* 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));
index b47e09ffc309056125a32505c0a6facf0f71ad19..f78ec1abecdaf10e367a9d56d87d0b021a47756d 100644 (file)
@@ -29,7 +29,7 @@ freadptr (FILE *fp, size_t *sizep)
   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;
index 4299e82fea46dce1e03da6adce17133bff3daa84..311c6990c93377e54c197c9f8b58fee2163d35f8 100644 (file)
@@ -34,7 +34,7 @@ static inline void
 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;
index 536dfaf680b61f02f1cfe50b54b242d25c34c482..ac0af5785ec79acaa5ecd4a21d4624a4fdedeca5 100644 (file)
@@ -41,7 +41,7 @@ rpl_fseeko (FILE *fp, off_t offset, int whence)
 #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)
index 69fcd32f1e41bf518f8c4735317a0f1347af64b9..ebe358080215f3e5d305b8e619cbcb3fa96bea46 100644 (file)
@@ -29,7 +29,7 @@ fseterr (FILE *fp)
   /* 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;
index 691ddc573b5325960e43a52ddbb0e62bb77edf8d..ed7be9d9b01d79c5161f3ec44d2a052b71bb07c8 100644 (file)
@@ -27,7 +27,7 @@ fwritable (FILE *fp)
   /* 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;
index 7ce09259764828ab3bdf5f26bb85cb14a07d9a43..4ecf4b0a09fe53dcb176c3791f7314bd56a72e1a 100644 (file)
@@ -27,7 +27,7 @@ fwriting (FILE *fp)
   /* 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;