]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Portability to Tru64 V4.0.
authorJim Meyering <jim@meyering.net>
Wed, 25 Oct 2006 09:47:06 +0000 (11:47 +0200)
committerJim Meyering <jim@meyering.net>
Wed, 25 Oct 2006 09:47:06 +0000 (11:47 +0200)
* src/system.h (ftello) [!HAVE_FSEEKO && !defined ftello]:
Define inline replacement function.
This (along with a yesterday's fix for autoconf's
_AC_SYS_LARGEFILE_MACRO_VALUE macro) makes it so coreutils
now builds once more on Tru64 V4.0.  Reported by Nelson Beebe.

ChangeLog
src/system.h

index 195ca75ef7339571092c3b08cdf98ee583d430b9..2ee39fe7e7f56fe2735680fa8718e9634f2559e6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2006-10-25  Jim Meyering  <jim@meyering.net>
+
+       Portability to Tru64 V4.0.
+       * src/system.h (ftello) [!HAVE_FSEEKO && !defined ftello]:
+       Define inline replacement function.
+       This (along with a yesterday's fix for autoconf's
+       _AC_SYS_LARGEFILE_MACRO_VALUE macro) makes it so coreutils
+       now builds once more on Tru64 V4.0.  Reported by Nelson Beebe.
+
 2006-10-25  Bruno Haible  <bruno@clisp.org>
 
        * src/cat.c (infile): Add "const" to declaration.
index 87a379e22f1377185411a6c044c614474181314d..efe92909849b22bb587613b5c8512bda9b6e45d9 100644 (file)
@@ -515,10 +515,26 @@ enum
 # define EOVERFLOW EINVAL
 #endif
 
-#if ! HAVE_FSEEKO && ! defined fseeko
-# define fseeko(s, o, w) ((o) == (long int) (o)                \
-                         ? fseek (s, o, w)             \
-                         : (errno = EOVERFLOW, -1))
+#if ! HAVE_FSEEKO
+# if ! defined fseeko
+#  define fseeko(s, o, w) ((o) == (long int) (o)       \
+                          ? fseek (s, o, w)            \
+                          : (errno = EOVERFLOW, -1))
+# endif
+# if ! defined ftello
+static inline off_t ftello (FILE *stream)
+{
+  off_t off = ftell (stream);
+  if (off < 0)
+    return off;
+  if (off != (long int) off)
+    {
+      errno = EOVERFLOW;
+      return -1;
+    }
+  return off;
+}
+# endif
 #endif
 
 #if ! HAVE_SYNC