[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Cvs-cvs] ccvs lib/stdbool_.h lib/ChangeLog m4/stdbool.m4...
From: |
Mark D. Baushke |
Subject: |
[Cvs-cvs] ccvs lib/stdbool_.h lib/ChangeLog m4/stdbool.m4... |
Date: |
Fri, 27 Jan 2006 07:38:46 +0000 |
CVSROOT: /cvsroot/cvs
Module name: ccvs
Branch:
Changes by: Mark D. Baushke <address@hidden> 06/01/27 07:38:46
Modified files:
lib : stdbool_.h ChangeLog
m4 : stdbool.m4 ChangeLog
Log message:
* lib/stdbool_.h: Update from GNULIB.
* m4/stdbool.m4: Update from GNULIB.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/cvs/ccvs/lib/stdbool_.h.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/cvs/ccvs/lib/ChangeLog.diff?tr1=1.490&tr2=1.491&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/cvs/ccvs/m4/stdbool.m4.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/cvs/ccvs/m4/ChangeLog.diff?tr1=1.156&tr2=1.157&r1=text&r2=text
Patches:
Index: ccvs/lib/ChangeLog
diff -u ccvs/lib/ChangeLog:1.490 ccvs/lib/ChangeLog:1.491
--- ccvs/lib/ChangeLog:1.490 Wed Jan 25 12:53:38 2006
+++ ccvs/lib/ChangeLog Fri Jan 27 07:38:45 2006
@@ -1,3 +1,7 @@
+2006-01-26 Mark D. Baushke <address@hidden>
+
+ * stdbool_.h: Update from GNULIB.
+
2006-01-25 Mark D. Baushke <address@hidden>
* chdir-long.c, getopt.c, gettime.c, glob-libc.h, glob_.h,
Index: ccvs/lib/stdbool_.h
diff -u ccvs/lib/stdbool_.h:1.3 ccvs/lib/stdbool_.h:1.4
--- ccvs/lib/stdbool_.h:1.3 Wed Jan 25 12:53:38 2006
+++ ccvs/lib/stdbool_.h Fri Jan 27 07:38:45 2006
@@ -78,23 +78,29 @@
typedef bool _Bool;
# endif
#else
-# if @HAVE__BOOL@
-# if defined __HP_cc || defined __xlc__
- /* Some HP-UX cc and AIX IBM C compiler versions have compiler bugs when
- the built-in _Bool type is used. See
- http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
- http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
- http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html
- Override it. */
-# define _Bool signed char
+# if !defined __GNUC__
+ /* If @HAVE__BOOL@:
+ Some HP-UX cc and AIX IBM C compiler versions have compiler bugs when
+ the built-in _Bool type is used. See
+ http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
+ http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
+ http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html
+ Similar bugs are likely with other compilers as well; this file
+ wouldn't be used if <stdbool.h> was working.
+ So we override the _Bool type.
+ If address@hidden@:
+ Need to define _Bool ourselves. As 'signed char' or as an enum type?
+ Use of a typedef, with SunPRO C, leads to a stupid
+ "warning: _Bool is a keyword in ISO C99".
+ Use of an enum type, with IRIX cc, leads to a stupid
+ "warning(1185): enumerated type mixed with another type".
+ The only benefit of the enum type, debuggability, is not important
+ with these compilers. So use 'signed char' and no typedef. */
+# define _Bool signed char
enum { false = 0, true = 1 };
-# endif
# else
-# 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
+ /* With this compiler, trust the _Bool type if the compiler has it. */
+# if address@hidden@
typedef enum { _Bool_must_promote_to_int = -1, false = 0, true = 1 } _Bool;
# endif
# endif
Index: ccvs/m4/ChangeLog
diff -u ccvs/m4/ChangeLog:1.156 ccvs/m4/ChangeLog:1.157
--- ccvs/m4/ChangeLog:1.156 Wed Jan 25 12:53:43 2006
+++ ccvs/m4/ChangeLog Fri Jan 27 07:38:46 2006
@@ -1,3 +1,7 @@
+2006-01-26 Mark D. Baushke <address@hidden>
+
+ * stdbool.m4: Update from GNULIB.
+
2006-01-25 Mark D. Baushke <address@hidden>
* fpending.m4, getopt.m4, gnulib-comp.m4, openat.m4, socklen.m4,
Index: ccvs/m4/stdbool.m4
diff -u ccvs/m4/stdbool.m4:1.5 ccvs/m4/stdbool.m4:1.6
--- ccvs/m4/stdbool.m4:1.5 Wed Jan 25 12:53:43 2006
+++ ccvs/m4/stdbool.m4 Fri Jan 27 07:38:46 2006
@@ -74,7 +74,7 @@
_Bool n[m];
char o[sizeof n == m * sizeof n[0] ? 1 : -1];
char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
- #if defined __xlc__
+ #if defined __xlc__ || defined __GNUC__
/* Catch a bug in IBM AIX xlc compiler version 6.0.0.0
reported by James Lemley on 2005-10-05; see
http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html
@@ -86,7 +86,10 @@
Let us hope that IBM fixes the xlc bug, and also adds
support for this kind of constant expression. In the
meantime, this test will reject xlc, which is OK, since
- our stdbool.h substitute should suffice. */
+ our stdbool.h substitute should suffice. We also test
+ this with GCC, where it should work, to detect more
+ quickly whether someone messes up the test in the
+ future. */
char digs[] = "0123456789";
int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1);
#endif
@@ -98,9 +101,11 @@
_Bool *pq = &q;
],
[
+ *pq |= q;
+ *pq |= ! q;
/* Refer to every declared value, to avoid compiler optimizations. */
return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
- + !m + !n + !o + !p);
+ + !m + !n + !o + !p + !q + !pq);
],
[ac_cv_header_stdbool_h=yes],
[ac_cv_header_stdbool_h=no])])
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Cvs-cvs] ccvs lib/stdbool_.h lib/ChangeLog m4/stdbool.m4...,
Mark D. Baushke <=