bug-coreutils
[Top][All Lists]
Advanced

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

minor porting fixes (Sun Forte 6U2, machines with very wide int)


From: Paul Eggert
Subject: minor porting fixes (Sun Forte 6U2, machines with very wide int)
Date: Wed, 11 Aug 2004 15:28:46 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

I installed this miscellaneous set of minor porting changes:

2004-08-11  Paul Eggert  <address@hidden>

        * lib/fts.c (O_DIRECTORY): Define to 0 if the system doesn't define.

        * lib/settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.

        * lib/xgethostname.c: Do not include error.h.  (merge from gnulib).

        * lib/obstack.c: Include <inttypes.h> and <stdint.h> if available.
        (union fooround): Use uintmax_t, not long int.
        The rest is a merge from libc:
        [defined _LIBC]: Include <shlib-compat.h>.
        (_obstack) [defined _LIBC]: Remove after 2.3.4.
        * m4/obstack.m4 (gl_PREREQ_OBSTACK): Require
        gl_AC_HEADER_INTTYPES_H, gl_AC_HEADER_STDINT_H, gl_AC_TYPE_UINTMAX_T.

Index: lib/fts.c
===================================================================
RCS file: /home/eggert/coreutils/cu/lib/fts.c,v
retrieving revision 1.18
diff -p -u -r1.18 fts.c
--- lib/fts.c   9 Aug 2004 23:34:15 -0000       1.18
+++ lib/fts.c   11 Aug 2004 22:18:36 -0000
@@ -162,6 +162,10 @@ static int      fts_safe_changedir __P((
 # define SIZE_MAX ((size_t) -1)
 #endif
 
+#ifndef O_DIRECTORY
+# define O_DIRECTORY 0
+#endif
+
 /* The extra casts work around common compiler bugs.  */
 #define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
 
Index: lib/settime.c
===================================================================
RCS file: /home/eggert/coreutils/cu/lib/settime.c,v
retrieving revision 1.2
diff -p -u -r1.2 settime.c
--- lib/settime.c       5 Aug 2004 23:01:05 -0000       1.2
+++ lib/settime.c       11 Aug 2004 22:20:02 -0000
@@ -67,8 +67,8 @@ settime (struct timespec const *ts)
 
 #if HAVE_STIME
   return stime (&ts->tv_sec);
-#endif
-
+#else
   errno = ENOSYS;
   return -1;
+#endif
 }
Index: lib/xgethostname.c
===================================================================
RCS file: /home/eggert/coreutils/cu/lib/xgethostname.c,v
retrieving revision 1.20
diff -p -u -r1.20 xgethostname.c
--- lib/xgethostname.c  2 Aug 2004 21:52:07 -0000       1.20
+++ lib/xgethostname.c  11 Aug 2004 22:05:29 -0000
@@ -33,7 +33,6 @@
 # include <unistd.h>
 #endif
 
-#include "error.h"
 #include "xalloc.h"
 
 #ifndef ENAMETOOLONG
Index: lib/obstack.c
===================================================================
RCS file: /home/eggert/coreutils/cu/lib/obstack.c,v
retrieving revision 1.27
diff -p -u -r1.27 obstack.c
--- lib/obstack.c       10 Aug 2004 05:43:11 -0000      1.27
+++ lib/obstack.c       11 Aug 2004 22:04:52 -0000
@@ -24,6 +24,7 @@
 
 #ifdef _LIBC
 # include <obstack.h>
+# include <shlib-compat.h>
 #else
 # include "obstack.h"
 #endif
@@ -59,10 +60,17 @@
 #ifndef ELIDE_CODE
 
 
+# if HAVE_INTTYPES_H
+#  include <inttypes.h>
+# endif
+# if HAVE_STDINT_H || defined _LIBC
+#  include <stdint.h>
+# endif
+
 /* Determine default alignment.  */
 union fooround
 {
-  long int i;
+  uintmax_t i;
   long double d;
   void *p;
 };
@@ -103,10 +111,13 @@ int obstack_exit_failure = EXIT_FAILURE;
 # endif
 
 # ifdef _LIBC
+#  if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4
 /* A looong time ago (before 1994, anyway; we're not sure) this global variable
    was used by non-GNU-C macros to avoid multiple evaluation.  The GNU C
    library still exports it because somebody might use it.  */
-struct obstack *_obstack;
+struct obstack *_obstack_compat;
+compat_symbol (libc, _obstack_compat, _obstack, GLIBC_2_0);
+#  endif
 # endif
 
 /* Define a macro that either calls functions with the traditional malloc/free
Index: m4/obstack.m4
===================================================================
RCS file: /home/eggert/coreutils/cu/m4/obstack.m4,v
retrieving revision 1.4
diff -p -u -r1.4 obstack.m4
--- m4/obstack.m4       12 Sep 2003 20:16:13 -0000      1.4
+++ m4/obstack.m4       11 Aug 2004 21:58:33 -0000
@@ -1,5 +1,5 @@
-# obstack.m4 serial 2
-dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+# obstack.m4 serial 3
+dnl Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
 dnl This file is free software, distributed under the terms of the GNU
 dnl General Public License.  As a special exception to the GNU General
 dnl Public License, this file may be distributed as part of a program
@@ -16,4 +16,10 @@ AC_DEFUN([gl_OBSTACK],
 ])
 
 # Prerequisites of lib/obstack.c.
-AC_DEFUN([gl_PREREQ_OBSTACK], [:])
+AC_DEFUN([gl_PREREQ_OBSTACK],
+[
+  AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
+  AC_REQUIRE([gl_AC_HEADER_STDINT_H])
+  AC_REQUIRE([gl_AC_TYPE_UINTMAX_T])
+  :
+])




reply via email to

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