changeset 9876:057a5220dfd5

Add tentative support for OpenServer.
author Bruno Haible <bruno@clisp.org>
date Tue, 08 Apr 2008 13:11:19 +0200
parents 44146d346042
children f7b424277771
files 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
diffstat 12 files changed, 82 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2008-04-08  Bruno Haible  <bruno@clisp.org>
+
+	Add tentative support for OpenServer.
+	* lib/fbufmode.c (fbufmode): Add conditional define for _flag, _base,
+	_ptr, _cnt.
+	* 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 Roger Cornelius <rac@tenzing.org> and
+	Brian K. White <brian@aljex.com>.
+
 2008-04-06  Jim Meyering  <meyering@redhat.com>
 
 	* gnulib-tool (func_add_or_update): s/backuped/backed up/ in diagnostic
--- a/lib/fbufmode.c
+++ b/lib/fbufmode.c
@@ -1,5 +1,5 @@
 /* Retrieve information about a FILE stream.
-   Copyright (C) 2007 Free Software Foundation, Inc.
+   Copyright (C) 2007-2008 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -46,7 +46,7 @@
   if (fp->_flags & __SNBF)
     return _IONBF;
   return _IOFBF;
-#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, mingw */
+#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw */
 # if HAVE___FLBF                    /* Solaris >= 7 */
   if (__flbf (fp))
     return _IOLBF;
@@ -64,6 +64,9 @@
 		       } *) fp)
   return fp_->_flag & (_IONBF | _IOFBF);
 # else
+#  if defined _SCO_DS               /* OpenServer */
+#   define _flag __flag
+#  endif
   if (fp->_flag & _IONBF)
     return _IONBF;
   return _IOFBF;
--- a/lib/fpurge.c
+++ b/lib/fpurge.c
@@ -1,5 +1,5 @@
 /* Flushing buffers of a FILE stream.
-   Copyright (C) 2007 Free Software Foundation, Inc.
+   Copyright (C) 2007-2008 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -90,7 +90,12 @@
       fp_ub._base = NULL;
     }
   return 0;
-# elif defined _IOERR               /* AIX, HP-UX, IRIX, OSF/1, Solaris, mingw */
+# elif defined _IOERR               /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw */
+#  if defined _SCO_DS               /* OpenServer */
+#   define _base __base
+#   define _ptr __ptr
+#   define _cnt __cnt
+#  endif
   fp->_ptr = fp->_base;
   if (fp->_ptr != NULL)
     fp->_cnt = 0;
--- a/lib/freadable.c
+++ b/lib/freadable.c
@@ -1,5 +1,5 @@
 /* Retrieve information about a FILE stream.
-   Copyright (C) 2007 Free Software Foundation, Inc.
+   Copyright (C) 2007-2008 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -29,7 +29,10 @@
   return (fp->_flags & _IO_NO_READS) == 0;
 #elif defined __sferror             /* FreeBSD, NetBSD, OpenBSD, MacOS X, Cygwin */
   return (fp->_flags & (__SRW | __SRD)) != 0;
-#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, mingw */
+#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw */
+# if defined _SCO_DS                /* OpenServer */
+#  define _flag __flag
+# endif
   return (fp->_flag & (_IORW | _IOREAD)) != 0;
 #elif defined __QNX__               /* QNX */
   return (fp->_Mode & 0x1 /* _MOPENR */) != 0;
--- a/lib/freadahead.c
+++ b/lib/freadahead.c
@@ -43,7 +43,7 @@
     return 0;
   return fp->_r
 	 + (HASUB (fp) ? fp->_ur : 0);
-#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, mingw */
+#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw */
 # if defined __sun && defined _LP64 /* Solaris/{SPARC,AMD64} 64-bit */
 #  define fp_ ((struct { unsigned char *_ptr; \
 			 unsigned char *_base; \
@@ -56,6 +56,10 @@
     return 0;
   return fp_->_cnt;
 # else
+#  if defined _SCO_DS               /* OpenServer */
+#   define _flag __flag
+#   define _cnt __cnt
+#  endif
   if ((fp->_flag & _IOWRT) != 0)
     return 0;
   return fp->_cnt;
--- a/lib/freading.c
+++ b/lib/freading.c
@@ -1,5 +1,5 @@
 /* Retrieve information about a FILE stream.
-   Copyright (C) 2007 Free Software Foundation, Inc.
+   Copyright (C) 2007-2008 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -35,7 +35,10 @@
 	      && fp->_IO_read_base != NULL));
 #elif defined __sferror             /* FreeBSD, NetBSD, OpenBSD, MacOS X, Cygwin */
   return (fp->_flags & __SRD) != 0;
-#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, mingw */
+#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw */
+# if defined _SCO_DS                /* OpenServer */
+#  define _flag __flag
+# endif
   return (fp->_flag & _IOREAD) != 0;
 #elif defined __UCLIBC__            /* uClibc */
   return (fp->__modeflags & (__FLAG_READONLY | __FLAG_READING)) != 0;
--- a/lib/freadptr.c
+++ b/lib/freadptr.c
@@ -41,7 +41,7 @@
     return NULL;
   *sizep = size;
   return (const char *) fp->_p;
-#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, mingw */
+#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw */
 # if defined __sun && defined _LP64 /* Solaris/{SPARC,AMD64} 64-bit */
 #  define fp_ ((struct { unsigned char *_ptr; \
 			 unsigned char *_base; \
@@ -58,6 +58,11 @@
   *sizep = size;
   return (const char *) fp_->_ptr;
 # else
+#  if defined _SCO_DS               /* OpenServer */
+#   define _flag __flag
+#   define _ptr __ptr
+#   define _cnt __cnt
+#  endif
   if ((fp->_flag & _IOWRT) != 0)
     return NULL;
   size = fp->_cnt;
--- a/lib/freadseek.c
+++ b/lib/freadseek.c
@@ -37,7 +37,7 @@
 #elif defined __sferror             /* FreeBSD, NetBSD, OpenBSD, MacOS X, Cygwin */
   fp->_p += increment;
   fp->_r -= increment;
-#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, mingw */
+#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw */
 # if defined __sun && defined _LP64 /* Solaris/{SPARC,AMD64} 64-bit */
 #  define fp_ ((struct { unsigned char *_ptr; \
 			 unsigned char *_base; \
@@ -49,6 +49,10 @@
   fp_->_ptr += increment;
   fp_->_cnt -= increment;
 # else
+#  if defined _SCO_DS               /* OpenServer */
+#   define _ptr __ptr
+#   define _cnt __cnt
+#  endif
   fp->_ptr += increment;
   fp->_cnt -= increment;
 # endif
--- a/lib/fseeko.c
+++ b/lib/fseeko.c
@@ -1,5 +1,5 @@
 /* An fseeko() function that, together with fflush(), is POSIX compliant.
-   Copyright (C) 2007 Free Software Foundation, Inc.
+   Copyright (C) 2007-2008 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -70,7 +70,7 @@
 		    ? fp->_bf._size
 		    : 0)
       && fp_ub._base == NULL)
-#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, mingw */
+#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw */
 # if defined __sun && defined _LP64 /* Solaris/{SPARC,AMD64} 64-bit */
 #  define fp_ ((struct { unsigned char *_ptr; \
 			 unsigned char *_base; \
@@ -82,6 +82,11 @@
   if (fp_->_ptr == fp_->_base
       && (fp_->_ptr == NULL || fp_->_cnt == 0))
 # else
+#  if defined _SCO_DS               /* OpenServer */
+#   define _base __base
+#   define _ptr __ptr
+#   define _cnt __cnt
+#  endif
   if (fp->_ptr == fp->_base
       && (fp->_ptr == NULL || fp->_cnt == 0))
 # endif
@@ -112,7 +117,10 @@
 	  fp->_offset = pos;
 	  fp->_flags |= __SOFF;
 	  fp->_flags &= ~__SEOF;
-#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, mingw */
+#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw */
+# if defined _SCO_DS                /* OpenServer */
+#  define _flag __flag
+# endif
           fp->_flag &= ~_IOEOF;
 #endif
 	  return 0;
--- a/lib/fseterr.c
+++ b/lib/fseterr.c
@@ -1,5 +1,5 @@
 /* Set the error indicator of a stream.
-   Copyright (C) 2007 Free Software Foundation, Inc.
+   Copyright (C) 2007-2008 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -31,7 +31,7 @@
   fp->_flags |= _IO_ERR_SEEN;
 #elif defined __sferror             /* FreeBSD, NetBSD, OpenBSD, MacOS X, Cygwin */
   fp->_flags |= __SERR;
-#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, mingw */
+#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw */
 # if defined __sun && defined _LP64 /* Solaris/{SPARC,AMD64} 64-bit */
 #  define fp_ ((struct { unsigned char *_ptr; \
 			 unsigned char *_base; \
@@ -42,6 +42,9 @@
 		       } *) fp)
   fp_->_flag |= _IOERR;
 # else
+#  if defined _SCO_DS               /* OpenServer */
+#   define _flag __flag
+#  endif
   fp->_flag |= _IOERR;
 # endif
 #elif defined __UCLIBC__            /* uClibc */
--- a/lib/fwritable.c
+++ b/lib/fwritable.c
@@ -1,5 +1,5 @@
 /* Retrieve information about a FILE stream.
-   Copyright (C) 2007 Free Software Foundation, Inc.
+   Copyright (C) 2007-2008 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -29,7 +29,10 @@
   return (fp->_flags & _IO_NO_WRITES) == 0;
 #elif defined __sferror             /* FreeBSD, NetBSD, OpenBSD, MacOS X, Cygwin */
   return (fp->_flags & (__SRW | __SWR)) != 0;
-#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, mingw */
+#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw */
+# if defined _SCO_DS                /* OpenServer */
+#  define _flag __flag
+# endif
   return (fp->_flag & (_IORW | _IOWRT)) != 0;
 #elif defined __QNX__               /* QNX */
   return (fp->_Mode & 0x2 /* _MOPENW */) != 0;
--- a/lib/fwriting.c
+++ b/lib/fwriting.c
@@ -1,5 +1,5 @@
 /* Retrieve information about a FILE stream.
-   Copyright (C) 2007 Free Software Foundation, Inc.
+   Copyright (C) 2007-2008 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -29,7 +29,10 @@
   return (fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) != 0;
 #elif defined __sferror             /* FreeBSD, NetBSD, OpenBSD, MacOS X, Cygwin */
   return (fp->_flags & __SWR) != 0;
-#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, mingw */
+#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw */
+# if defined _SCO_DS                /* OpenServer */
+#  define _flag __flag
+# endif
   return (fp->_flag & _IOWRT) != 0;
 #elif defined __UCLIBC__            /* uClibc */
   return (fp->__modeflags & __FLAG_WRITING) != 0;