]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(verify_dcl): Rename from VERIFY. Update use.
authorJim Meyering <jim@meyering.net>
Mon, 4 Jul 2005 14:47:42 +0000 (14:47 +0000)
committerJim Meyering <jim@meyering.net>
Mon, 4 Jul 2005 14:47:42 +0000 (14:47 +0000)
lib/argmatch.h

index 45bfa03a7d5af5819d5699b556ab96ee6537fd13..cb7e39cdfbafe49de8935acab43802696bf71a58 100644 (file)
 
 # include <stddef.h>
 
-# ifndef VERIFY
+# ifndef verify_dcl
 #  define GL_CONCAT0(x, y) x##y
 #  define GL_CONCAT(x, y) GL_CONCAT0 (x, y)
-/* Verify a requirement at compile-time (unlike assert, which is runtime).  */
-#  define VERIFY(assertion) \
-    struct GL_CONCAT (compile_time_assert_, __LINE__) \
-      { char a[(assertion) ? 1 : -1]; }
+
+/* Verify requirement, R, at compile-time, as a declaration.
+   The implementation uses a struct declaration whose name includes the
+   expansion of __LINE__, so there is a small chance that two uses of
+   verify_dcl from different files will end up colliding (for example,
+   f.c includes f.h and verify_dcl is used on the same line in each).  */
+#  define verify_dcl(R) \
+    struct GL_CONCAT (ct_assert_, __LINE__) { char a[(R) ? 1 : -1]; }
 # endif
 
 # define ARRAY_CARDINALITY(Array) (sizeof (Array) / sizeof *(Array))
@@ -45,7 +49,7 @@
    ARGMATCH_ASSERT is for backward compatibility only.  */
 
 # define ARGMATCH_VERIFY(Arglist, Vallist) \
-    VERIFY (ARGMATCH_CONSTRAINT (Arglist, Vallist))
+    verify_dcl (ARGMATCH_CONSTRAINT (Arglist, Vallist))
 
 # define ARGMATCH_ASSERT(Arglist, Vallist) \
   assert (ARGMATCH_CONSTRAINT (Arglist, Vallist))