]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Update from gnulib.
authorBruno Haible <bruno@clisp.org>
Fri, 15 Aug 2003 16:04:39 +0000 (16:04 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:10:50 +0000 (12:10 +0200)
gettext-tools/lib/ChangeLog
gettext-tools/lib/mbswidth.h
gettext-tools/lib/minmax.h
gettext-tools/lib/stdbool_.h
gettext-tools/lib/stpcpy.c
gettext-tools/lib/strcspn.c
gettext-tools/lib/strpbrk.c

index 64157391ec9d21b72ee1fb98d13e5fce7640bf3e..e1119b86922dcd6d20e1fcd8607616dac9ab7876 100644 (file)
@@ -1,3 +1,16 @@
+2003-08-11  Bruno Haible  <bruno@clisp.org>
+
+       * stdbool_.h: Update from gnulib.
+       2003-08-11  Bruno Haible  <bruno@clisp.org>
+               * stdbool_.h (_Bool): Undo last change; instead use a negative
+               enum value to ensure that _Bool promotes to int. Use #define
+               for _Bool when using the Solaris C compiler. Adds comments
+               suggested by Paul Eggert.
+       2003-08-03  Paul Eggert  <eggert@twinsun.com>
+               * stdbool_.h (_Bool): Make it signed char, instead of
+               an enum type, so that it's guaranteed to promote to int.  See:
+               <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
+
 2003-05-28  Paul Eggert  <eggert@twinsun.com>
 
        * safe-read.c (CHAR_BIT): Don't define, since <limits.h> is guaranteed
 
        * copy-file.c: Include <stddef.h>, for size_t.
 
+2003-03-03  Paul Eggert  <eggert@twinsun.com>
+            Bruno Haible  <bruno@clisp.org>
+
+       * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
+       Reported by John Hughes, see
+       http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
+
 2003-01-28  Bruno Haible  <bruno@clisp.org>
 
        * c-ctype.h: Assume C_CTYPE_CONSECUTIVE_DIGITS.
        Optimize.
        Suggested by Paul Eggert.
 
+2003-01-23  Bruno Haible  <bruno@clisp.org>
+
+       * minmax.h: Add comments from Paul Eggert.
+
+2002-11-15  Bruno Haible  <bruno@clisp.org>
+
+       * strcspn.c: Include <stddef.h>.
+       * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
+
 2003-08-14  Bruno Haible  <bruno@clisp.org>
 
        * config.charset: Add support for Linux libc5. Based on data from
index 40d4cba0419debe8bd3b802acf05ef59d6388ef8..cd41c9f20efbeb6545db9cdcd025890218b1cc1c 100644 (file)
@@ -1,5 +1,5 @@
 /* Determine the number of screen columns needed for a string.
-   Copyright (C) 2000-2002 Free Software Foundation, Inc.
+   Copyright (C) 2000-2003 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
 
 #include <stddef.h>
 
+/* Avoid a clash of our mbswidth() with a function of the same name defined
+   in UnixWare 7.1.1 <wchar.h>.  We need this #include before the #define
+   below.  */
+#if HAVE_WCHAR_H
+# include <wchar.h>
+#endif
+
+
 /* Optional flags to influence mbswidth/mbsnwidth behavior.  */
 
 /* If this bit is set, return -1 upon finding an invalid or incomplete
@@ -28,6 +36,7 @@
    control characters and 1 otherwise.  */
 #define MBSW_REJECT_UNPRINTABLE        2
 
+
 /* Returns the number of screen columns needed for STRING.  */
 #define mbswidth gnu_mbswidth  /* avoid clash with UnixWare 7.1.1 function */
 extern int mbswidth (const char *string, int flags);
index 376fc13480c1a865280fb18a863c316c10e1584f..6714cae18e08c8f6d4c9d9be1aca87e011ad1d5f 100644 (file)
 #ifndef _MINMAX_H
 #define _MINMAX_H
 
+/* Note: MIN, MAX are also defined in <sys/param.h> on some systems
+   (glibc, IRIX, HP-UX, OSF/1).  Therefore you might get warnings about
+   MIN, MAX macro redefinitions on some systems; the workaround is to
+   #include this file as the last one among the #include list.  */
+
 /* Before we define the following symbols we get the <limits.h> file
    since otherwise we get redefinitions on some systems.  */
 #include <limits.h>
 
+/* Note: MIN and MAX should preferrably be used with two arguments of the
+   same type.  They might not return the minimum and maximum of their two
+   arguments, if the arguments have different types or have unusual
+   floating-point values.  For example, on a typical host with 32-bit 'int',
+   64-bit 'long long', and 64-bit IEEE 754 'double' types:
+
+     MAX (-1, 2147483648) returns 4294967295.
+     MAX (9007199254740992.0, 9007199254740993) returns 9007199254740992.0.
+     MAX (NaN, 0.0) returns 0.0.
+     MAX (+0.0, -0.0) returns -0.0.
+
+   and in each case the answer is in some sense bogus.  */
+
 /* MAX(a,b) returns the maximum of A and B.  */
 #ifndef MAX
 # if __STDC__ && defined __GNUC__ && __GNUC__ >= 2
index 69f6ef725fe3c76c80d7716141d4b083dc79c265..3dbb51b24b68b20621d7a6bb61d17cc75d3f9082 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2002 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software; you can redistribute it and/or modify
 
 /* ISO C 99 <stdbool.h> for platforms that lack it.  */
 
+/* Usage suggestions:
+
+   Programs that use <stdbool.h> should be aware of some limitations
+   and standards compliance issues.
+
+   Standards compliance:
+
+       - <stdbool.h> must be #included before 'bool', 'false', 'true'
+         can be used.
+
+       - You cannot assume that sizeof (bool) == 1.
+
+       - Programs should not undefine the macros bool, true, and false,
+         as C99 lists that as an "obsolescent feature".
+
+   Limitations of this substitute, when used in a C89 environment:
+
+       - <stdbool.h> must be #included before the '_Bool' type can be used.
+
+       - You cannot assume that _Bool is a typedef; it might be a macro.
+
+       - In C99, casts and automatic conversions to '_Bool' or 'bool' are
+         performed in such a way that every nonzero value gets converted
+         to 'true', and zero gets converted to 'false'.  This doesn't work
+         with this substitute.  With this substitute, only the values 0 and 1
+         give the expected result when converted to _Bool' or 'bool'.
+
+   Also, it is suggested that programs use 'bool' rather than '_Bool';
+   this isn't required, but 'bool' is more common.  */
+
+
 /* 7.16. Boolean type and values */
 
 /* BeOS <sys/socket.h> already #defines false 0, true 1.  We use the same
 # undef true
 #endif
 
-/* For the sake of symbolic names in gdb, define _Bool as an enum type.  */
+/* For the sake of symbolic names in gdb, we define true and false as
+   enum constants, not only as macros.
+   It is tempting to write
+      typedef enum { false = 0, true = 1 } _Bool;
+   so that gdb prints values of type 'bool' symbolically. But if we do
+   this, values of type '_Bool' may promote to 'int' or 'unsigned int'
+   (see ISO C 99 6.7.2.2.(4)); however, '_Bool' must promote to 'int'
+   (see ISO C 99 6.3.1.1.(2)).  So we add a negative value to the
+   enum; this ensures that '_Bool' promotes to 'int'.  */
 #ifndef __cplusplus
 # if !@HAVE__BOOL@
-typedef enum { false = 0, true = 1 } _Bool;
+#  if defined __SUNPRO_C && (__SUNPRO_C < 0x550 || __STDC__ == 1)
+    /* Avoid stupid "warning: _Bool is a keyword in ISO C99".  */
+#   define _Bool signed char
+enum { false = 0, true = 1 };
+#  else
+typedef enum { _Bool_must_promote_to_int = -1, false = 0, true = 1 } _Bool;
+#  endif
 # endif
 #else
 typedef bool _Bool;
index 83d82775ebafab91fdbdc6d2964ba2a09cf03637..a01636cd1c603b35fd789172e87f10daf173fac5 100644 (file)
@@ -1,7 +1,8 @@
-/* Copyright (C) 1992, 1995, 1997, 2002 Free Software Foundation, Inc.
+/* stpcpy.c -- copy a string and return pointer to end of new string
+   Copyright (C) 1992, 1995, 1997, 1998 Free Software Foundation, Inc.
 
    NOTE: The canonical source of this file is maintained with the GNU C Library.
-   Bugs can be reported to bug-glibc@gnu.org.
+   Bugs can be reported to bug-glibc@prep.ai.mit.edu.
 
    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
index 8ff1109db2f826140a9588ba37c26f21fc6eabdc..2bbd906643b128c5cf69e1ef3d8e57a6278b4532 100644 (file)
@@ -22,6 +22,8 @@
 # include <config.h>
 #endif
 
+#include <stddef.h>
+
 #if defined _LIBC || HAVE_STRING_H
 # include <string.h>
 #else
index 1546233daa9199ce7dfd915dc5252d61d564b163..514b1e9a729b9f39e6f1bceae0f59847b62bf5b2 100644 (file)
@@ -20,7 +20,9 @@
 # include <config.h>
 #endif
 
-#if defined _LIBC || defined HAVE_CONFIG_H
+#include <stddef.h>
+
+#if defined _LIBC || HAVE_STRING_H
 # include <string.h>
 #endif