Port to Solaris/SPARC64.
authorBruno Haible <bruno@clisp.org>
Mon, 23 Apr 2007 08:01:35 +0000 (08:01 +0000)
committerBruno Haible <bruno@clisp.org>
Mon, 23 Apr 2007 08:01:35 +0000 (08:01 +0000)
ChangeLog
lib/fbufmode.c

index dd4ebf622b79ded70d0db1ce7f5c484fe52384c3..0d906d8449bcc8d191518092694ff62909466f59 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2007-04-23  Bruno Haible  <bruno@clisp.org>
+
+       * lib/fbufmode.c (fbufmode): Port to Solaris/SPARC64.
+
 2007-04-23  Bruno Haible  <bruno@clisp.org>
 
        * lib/fseterr.c (fseterr): Don't hardcode the value of _IOERR.
index 3090d8f9cf9090c154d21836ced10ce490248af1..6df6a20050cbe7a1b7baf3bf2aa77a77dd180259 100644 (file)
@@ -55,9 +55,13 @@ fbufmode (FILE *fp)
   if (fp->_flag & _IOLBF)
     return _IOLBF;
 # endif
+# if defined __sun && defined __sparc && defined _LP64 /* Solaris/SPARC 64-bit */
+  return ((unsigned int *) fp) [9] & (_IONBF | _IOFBF);
+# else
   if (fp->_flag & _IONBF)
     return _IONBF;
   return _IOFBF;
+# endif
 #else
  #error "Please port gnulib fbufmode.c to your platform! Look at the setvbuf implementation."
 #endif