shishi-commit
[Top][All Lists]
Advanced

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

CVS shishi/gl


From: shishi-commit
Subject: CVS shishi/gl
Date: Mon, 14 Mar 2005 15:32:14 +0100

Update of /home/cvs/shishi/gl
In directory dopio:/tmp/cvs-serv25930/gl

Modified Files:
        Makefile.am getdate.y gettext.h gettime.c mktime.c progname.c 
        setenv.c size_max.h timegm.h timespec.h vasnprintf.c 
        vasprintf.c xgethostname.c 
Added Files:
        strnlen.h 
Log Message:
Sync gnulib.

--- /home/cvs/shishi/gl/Makefile.am     2005/01/02 00:18:38     1.56
+++ /home/cvs/shishi/gl/Makefile.am     2005/03/14 14:32:13     1.57
@@ -113,12 +113,6 @@
 
 ## end   gnulib module gettext
 
-## begin gnulib module gettime
-
-libgnu_la_SOURCES += gettime.c
-
-## end   gnulib module gettime
-
 ## begin gnulib module progname
 
 libgnu_la_SOURCES += progname.h progname.c
--- /home/cvs/shishi/gl/getdate.y       2004/12/24 11:43:01     1.13
+++ /home/cvs/shishi/gl/getdate.y       2005/03/14 14:32:13     1.14
@@ -1,6 +1,8 @@
 %{
 /* Parse a string into an internal time stamp.
-   Copyright (C) 1999, 2000, 2002, 2003, 2004 Free Software Foundation, Inc.
+
+   Copyright (C) 1999, 2000, 2002, 2003, 2004, 2005 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
@@ -1125,8 +1127,7 @@
 
   if (! now)
     {
-      if (gettime (&gettime_buffer) != 0)
-       return false;
+      gettime (&gettime_buffer);
       now = &gettime_buffer;
     }
 
--- /home/cvs/shishi/gl/gettext.h       2003/08/22 17:48:49     1.2
+++ /home/cvs/shishi/gl/gettext.h       2005/03/14 14:32:14     1.3
@@ -1,5 +1,5 @@
 /* Convenience header for conditional use of GNU <libintl.h>.
-   Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc.
+   Copyright (C) 1995-1998, 2000-2002, 2004 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
@@ -36,6 +36,16 @@
 # include <locale.h>
 #endif
 
+/* Many header files from the libstdc++ coming with g++ 3.3 or newer include
+   <libintl.h>, which chokes if dcgettext is defined as a macro.  So include
+   it now, to make later inclusions of <libintl.h> a NOP.  */
+#if defined(__cplusplus) && defined(__GNUG__) && (__GNUC__ >= 3)
+# include <cstdlib>
+# if (__GLIBC__ >= 2) || _GLIBCXX_HAVE_LIBINTL_H
+#  include <libintl.h>
+# endif
+#endif
+
 /* Disabled NLS.
    The casts to 'const char *' serve the purpose of producing warnings
    for invalid uses of the value returned from these functions.
--- /home/cvs/shishi/gl/gettime.c       2004/07/02 09:19:39     1.2
+++ /home/cvs/shishi/gl/gettime.c       2005/03/14 14:32:14     1.3
@@ -1,5 +1,5 @@
 /* gettime -- get the system clock
-   Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2004, 2005 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
@@ -23,37 +23,31 @@
 
 #include "timespec.h"
 
-/* Get the system time.  */
+/* Get the system time into *TS.  */
 
-int
+void
 gettime (struct timespec *ts)
 {
-#if defined CLOCK_REALTIME && HAVE_CLOCK_GETTIME
+#if HAVE_NANOTIME
+  nanotime (ts);
+#else
+
+# if defined CLOCK_REALTIME && HAVE_CLOCK_GETTIME
   if (clock_gettime (CLOCK_REALTIME, ts) == 0)
-    return 0;
-#endif
+    return;
+# endif
 
-#if HAVE_GETTIMEOFDAY
+# if HAVE_GETTIMEOFDAY
   {
     struct timeval tv;
-    if (gettimeofday (&tv, 0) == 0)
-      {
-       ts->tv_sec = tv.tv_sec;
-       ts->tv_nsec = tv.tv_usec * 1000;
-       return 0;
-      }
+    gettimeofday (&tv, NULL);
+    ts->tv_sec = tv.tv_sec;
+    ts->tv_nsec = tv.tv_usec * 1000;
   }
-#endif
+# else
+  ts->tv_sec = time (NULL);
+  ts->tv_nsec = 0;
+# endif
 
-  {
-    time_t t = time (0);
-    if (t != (time_t) -1)
-      {
-       ts->tv_sec = t;
-       ts->tv_nsec = 0;
-       return 0;
-      }
-  }
-
-  return -1;
+#endif
 }
--- /home/cvs/shishi/gl/mktime.c        2004/12/17 13:44:05     1.7
+++ /home/cvs/shishi/gl/mktime.c        2005/03/14 14:32:14     1.8
@@ -1,5 +1,6 @@
 /* Convert a `struct tm' to a time_t value.
-   Copyright (C) 1993-1999, 2002, 2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 1993-1999, 2002, 2003, 2004, 2005 Free Software Foundation,
+   Inc.
    This file is part of the GNU C Library.
    Contributed by Paul Eggert (address@hidden).
 
@@ -60,10 +61,25 @@
    ? (a) >> (b)                \
    : (a) / (1 << (b)) - ((a) % (1 << (b)) < 0))
 
-/* The extra casts work around common compiler bugs.  */
+/* The extra casts in the following macros work around compiler bugs,
+   e.g., in Cray C 5.0.3.0.  */
+
+/* True if the arithmetic type T is an integer type.  bool counts as
+   an integer.  */
+#define TYPE_IS_INTEGER(t) ((t) 1.5 == 1)
+
+/* True if negative values of the integer type T use twos complement
+   representation.  */
+#define TYPE_TWOS_COMPLEMENT(t) ((t) - (t) 1 == (t) ((t) ~ (t) 1 + (t) 1))
+
+/* True if the arithmetic type T is signed.  */
 #define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
-/* The outer cast is needed to work around a bug in Cray C 5.0.3.0.
-   It is necessary at least when t == time_t.  */
+
+/* The maximum and minimum values for the integer type T.  These
+   macros have undefined behavior if T is signed and has padding bits
+   (i.e., bits that do not contribute to the value), or if T uses
+   signed-magnitude representation.  If this is a problem for you,
+   please let us know how to fix it for your host.  */
 #define TYPE_MINIMUM(t) ((t) (TYPE_SIGNED (t) \
                              ? ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1) : (t) 0))
 #define TYPE_MAXIMUM(t) ((t) (~ (t) 0 - TYPE_MINIMUM (t)))
@@ -79,8 +95,8 @@
 /* Verify a requirement at compile-time (unlike assert, which is runtime).  */
 #define verify(name, assertion) struct name { char a[(assertion) ? 1 : -1]; }
 
-verify (time_t_is_integer, (time_t) 0.5 == 0);
-verify (twos_complement_arithmetic, -1 == ~1 + 1);
+verify (time_t_is_integer, TYPE_IS_INTEGER (time_t));
+verify (twos_complement_arithmetic, TYPE_TWOS_COMPLEMENT (int));
 /* The code also assumes that signed integer overflow silently wraps
    around, but this assumption can't be stated without causing a
    diagnostic on some hosts.  */
--- /home/cvs/shishi/gl/progname.c      2004/11/12 13:18:49     1.5
+++ /home/cvs/shishi/gl/progname.c      2005/03/14 14:32:14     1.6
@@ -1,5 +1,5 @@
 /* Program name management.
-   Copyright (C) 2001-2003 Free Software Foundation, Inc.
+   Copyright (C) 2001-2003, 2005 Free Software Foundation, Inc.
    Written by Bruno Haible <address@hidden>, 2001.
 
    This program is free software; you can redistribute it and/or modify
@@ -31,7 +31,7 @@
 
 /* String containing name the program is called with.
    To be initialized by main().  */
-const char *program_name;
+const char *program_name = NULL;
 
 /* Set program_name, based on argv[0].  */
 void
--- /home/cvs/shishi/gl/setenv.c        2004/08/07 14:06:59     1.5
+++ /home/cvs/shishi/gl/setenv.c        2005/03/14 14:32:14     1.6
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992,1995-1999,2000-2004 Free Software Foundation, Inc.
+/* Copyright (C) 1992,1995-1999,2000-2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    This program is free software; you can redistribute it and/or modify
--- /home/cvs/shishi/gl/size_max.h      2005/01/29 01:04:45     1.1
+++ /home/cvs/shishi/gl/size_max.h      2005/03/14 14:32:14     1.2
@@ -3,16 +3,16 @@
    Written by Simon Josefsson.
 
    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
-   the Free Software Foundation; either version 2, or (at your option)
+   it under the terms of the GNU Lesser General Public License as published by
+   the Free Software Foundation; either version 2.1, or (at your option)
    any later version.
 
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
+   GNU Lesser General Public License for more details.
 
-   You should have received a copy of the GNU General Public License
+   You should have received a copy of the GNU Lesser General Public License
    along with this program; if not, write to the Free Software Foundation,
    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
--- /home/cvs/shishi/gl/timegm.h        2003/09/06 22:24:14     1.3
+++ /home/cvs/shishi/gl/timegm.h        2005/03/14 14:32:14     1.4
@@ -1,6 +1,6 @@
 /* Convert UTC calendar time to simple time.  Like mktime but assumes UTC.
 
-   Copyright (C) 2003 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2005 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
@@ -18,6 +18,6 @@
 
 #include <time.h>
 
-#ifndef HAVE_DECL_TIMEGM
+#if defined HAVE_DECL_TIMEGM && !HAVE_DECL_TIMEGM
 time_t timegm (struct tm *tm);
 #endif
--- /home/cvs/shishi/gl/timespec.h      2004/04/18 12:10:19     1.1
+++ /home/cvs/shishi/gl/timespec.h      2005/03/14 14:32:14     1.2
@@ -1,6 +1,6 @@
 /* timespec -- System time interface
 
-   Copyright (C) 2000, 2002, 2004 Free Software Foundation, Inc.
+   Copyright (C) 2000, 2002, 2004, 2005 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
@@ -65,7 +65,7 @@
 int nanosleep ();
 # endif
 
-int gettime (struct timespec *);
+void gettime (struct timespec *);
 int settime (struct timespec const *);
 
 #endif
--- /home/cvs/shishi/gl/vasnprintf.c    2004/09/16 23:18:43     1.8
+++ /home/cvs/shishi/gl/vasnprintf.c    2005/03/14 14:32:14     1.9
@@ -1,5 +1,5 @@
 /* vsprintf with automatic memory allocation.
-   Copyright (C) 1999, 2002-2004 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002-2005 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
@@ -51,6 +51,11 @@
 /* Checked size_t computations.  */
 #include "xsize.h"
 
+/* Some systems, like OSF/1 4.0 and Woe32, don't have EOVERFLOW.  */
+#ifndef EOVERFLOW
+# define EOVERFLOW E2BIG
+#endif
+
 #ifdef HAVE_WCHAR_T
 # ifdef HAVE_WCSLEN
 #  define local_wcslen wcslen
--- /home/cvs/shishi/gl/vasprintf.c     2004/09/16 23:18:43     1.4
+++ /home/cvs/shishi/gl/vasprintf.c     2005/03/14 14:32:14     1.5
@@ -1,5 +1,5 @@
 /* Formatted output to strings.
-   Copyright (C) 1999, 2002-2004 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002 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
--- /home/cvs/shishi/gl/xgethostname.c  2004/08/10 08:36:11     1.3
+++ /home/cvs/shishi/gl/xgethostname.c  2005/03/14 14:32:14     1.4
@@ -1,6 +1,6 @@
 /* xgethostname.c -- return current hostname with unlimited length
 
-   Copyright (C) 1992, 1996, 2000, 2001, 2003, 2004 Free Software
+   Copyright (C) 1992, 1996, 2000, 2001, 2003, 2004, 2005 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
@@ -69,7 +69,9 @@
          if (! hostname[size_1 - 1])
            break;
        }
-      else if (errno != 0 && errno != ENAMETOOLONG && errno != EINVAL)
+      else if (errno != 0 && errno != ENAMETOOLONG && errno != EINVAL
+              /* OSX/Darwin does this when the buffer is not large enough */
+              && errno != ENOMEM)
        {
          int saved_errno = errno;
          free (hostname);

--- /home/cvs/shishi/gl/strnlen.h       2005/03/14 14:32:15     NONE
+++ /home/cvs/shishi/gl/strnlen.h       2005/03/14 14:32:15     1.1
/* Find the length of STRING, but scan at most MAXLEN characters.
   Copyright (C) 2005 Free Software Foundation, Inc.
   Written by Simon Josefsson.

   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
   the Free Software Foundation; either version 2, or (at your option)
   any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License along
   with this program; if not, write to the Free Software Foundation,
   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */

#ifndef STRNLEN_H
#define STRNLEN_H

/* Get strnlen declaration, if available.  */
#include <string.h>

#if defined HAVE_DECL_STRNLEN && !HAVE_DECL_STRNLEN
extern size_t strnlen(const char *s, size_t maxlen);
#endif

#endif /* STRNLEN_H */




reply via email to

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