changeset 6323:af09cfa36fd5

* modules/exclude (Depends-on): Depend on verify. * modules/strtoimax (Depends-on): Likewise. * modules/utimecmp (Depends-on): Likewise. * lib/exclude.c: Include verify.h. (verify): Remove. All callers changed to use verify.h's version. * lib/strtoimax.c: Likewise. * lib/utimecmp.c: Likewis.e
author Paul Eggert <eggert@cs.ucla.edu>
date Sun, 02 Oct 2005 22:44:15 +0000
parents 716071856296
children 2fa7689c72c3
files ChangeLog lib/exclude.c lib/strtoimax.c lib/utimecmp.c m4/ChangeLog modules/exclude modules/strtoimax modules/utimecmp
diffstat 8 files changed, 41 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-10-02  Paul Eggert  <eggert@cs.ucla.edu>
+
+	* modules/exclude (Depends-on): Depend on verify.
+	* modules/strtoimax (Depends-on): Likewise.
+	* modules/utimecmp (Depends-on): Likewise.
+
 2005-09-27  Paul Eggert  <eggert@cs.ucla.edu>
 
 	* modules/regex (Depends-on): Add strcase.
--- a/lib/exclude.c
+++ b/lib/exclude.c
@@ -37,6 +37,7 @@
 #include "fnmatch.h"
 #include "strcase.h"
 #include "xalloc.h"
+#include "verify.h"
 
 #if USE_UNLOCKED_IO
 # include "unlocked-io.h"
@@ -54,9 +55,6 @@
   return IN_CTYPE_DOMAIN (c) && isspace (c);
 }
 
-/* Verify a requirement at compile-time (unlike assert, which is runtime).  */
-#define verify(name, assertion) struct name { char a[(assertion) ? 1 : -1]; }
-
 /* Non-GNU systems lack these options, so we don't need to check them.  */
 #ifndef FNM_CASEFOLD
 # define FNM_CASEFOLD 0
@@ -65,11 +63,10 @@
 # define FNM_LEADING_DIR 0
 #endif
 
-verify (EXCLUDE_macros_do_not_collide_with_FNM_macros,
-	(((EXCLUDE_ANCHORED | EXCLUDE_INCLUDE | EXCLUDE_WILDCARDS)
-	  & (FNM_PATHNAME | FNM_NOESCAPE | FNM_PERIOD | FNM_LEADING_DIR
-	     | FNM_CASEFOLD))
-	 == 0));
+verify (((EXCLUDE_ANCHORED | EXCLUDE_INCLUDE | EXCLUDE_WILDCARDS)
+	 & (FNM_PATHNAME | FNM_NOESCAPE | FNM_PERIOD | FNM_LEADING_DIR
+	    | FNM_CASEFOLD))
+	== 0);
 
 /* An exclude pattern-options pair.  The options are fnmatch options
    ORed with EXCLUDE_* options.  */
--- a/lib/strtoimax.c
+++ b/lib/strtoimax.c
@@ -32,8 +32,7 @@
 
 #include <stdlib.h>
 
-/* Verify a requirement at compile-time (unlike assert, which is runtime).  */
-#define verify(name, assertion) struct name { char a[(assertion) ? 1 : -1]; }
+#include "verify.h"
 
 #ifdef UNSIGNED
 # ifndef HAVE_DECL_STRTOULL
@@ -68,15 +67,13 @@
 strtoimax (char const *ptr, char **endptr, int base)
 {
 #if HAVE_LONG_LONG
-  verify (size_is_that_of_long_or_long_long,
-	  (sizeof (INT) == sizeof (long int)
-	   || sizeof (INT) == sizeof (long long int)));
+  verify (sizeof (INT) == sizeof (long int)
+	  || sizeof (INT) == sizeof (long long int));
 
   if (sizeof (INT) != sizeof (long int))
     return strtoll (ptr, endptr, base);
 #else
-  verify (size_is_that_of_long,
-	  sizeof (INT) == sizeof (long int));
+  verify (sizeof (INT) == sizeof (long int));
 #endif
 
   return strtol (ptr, endptr, base);
--- a/lib/utimecmp.c
+++ b/lib/utimecmp.c
@@ -39,11 +39,9 @@
 #include "stat-time.h"
 #include "timespec.h"
 #include "utimens.h"
+#include "verify.h"
 #include "xalloc.h"
 
-/* Verify a requirement at compile-time (unlike assert, which is runtime).  */
-#define verify(name, assertion) struct name { char a[(assertion) ? 1 : -1]; }
-
 #ifndef MAX
 # define MAX(a, b) ((a) > (b) ? (a) : (b))
 #endif
@@ -139,8 +137,8 @@
 
      time_t might be unsigned.  */
 
-  verify (time_t_is_integer, TYPE_IS_INTEGER (time_t));
-  verify (twos_complement_arithmetic, TYPE_TWOS_COMPLEMENT (int));
+  verify (TYPE_IS_INTEGER (time_t));
+  verify (TYPE_TWOS_COMPLEMENT (int));
 
   /* Destination and source time stamps.  */
   time_t dst_s = dst_stat->st_mtime;
--- a/m4/ChangeLog
+++ b/m4/ChangeLog
@@ -1,3 +1,23 @@
+2005-10-02  Paul Eggert  <eggert@cs.ucla.edu>
+
+	Sync from coreutils.
+	* openat.m4 (gl_FUNC_OPENAT): Check for fdopendir.
+	* ullong_max.m4 (gl_ULLONG_MAX): Simplify so that it merely
+	defines ULONG_MAX_LT_ULLONG_MAX.  Thomas M.Ott reports that
+	ULLONG_MAX doesn't work with 2.7.2.1.
+
+2005-10-02  Jim Meyering  <jim@meyering.net>
+
+	Sync from coreutils.
+	* utimes.m4 (gl_FUNC_UTIMES): Detect the version of utimes
+	from glibc-2.2.5 that fails for read-only files.
+
+2005-10-02  Alfred M. Szmidt  <ams@gnu.org>
+
+	Sync from coreutils.
+	* chdir-long.m4 (gl_FUNC_CHDIR_LONG): Compare $gl_have_path...
+	against `yes', rather than just testing for nonempty.
+
 2005-10-01  Simon Josefsson  <jas@extundo.com>
 
 	* getaddrinfo.m4: Include sys/types.h for sys/socket.h, on FreeBSD
--- a/modules/exclude
+++ b/modules/exclude
@@ -11,6 +11,7 @@
 strcase
 fnmatch-gnu
 stdbool
+verify
 
 configure.ac:
 gl_EXCLUDE
--- a/modules/strtoimax
+++ b/modules/strtoimax
@@ -11,6 +11,7 @@
 
 Depends-on:
 strtoll
+verify
 
 configure.ac:
 gl_FUNC_STRTOIMAX
@@ -24,4 +25,3 @@
 
 Maintainer:
 Paul Eggert
-
--- a/modules/utimecmp
+++ b/modules/utimecmp
@@ -14,6 +14,7 @@
 utimens
 xalloc
 stdbool
+verify
 
 configure.ac:
 gl_UTIMECMP