[Top][All Lists]

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

Re: proposed support for C1X-style static_assert

From: Paul Eggert
Subject: Re: proposed support for C1X-style static_assert
Date: Sun, 22 May 2011 18:37:49 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20110424 Thunderbird/3.1.10

On 05/22/11 16:09, Bruno Haible wrote:
> "verify.h" no longer defines the 'verify' macro if
> <assert.h> was already included in the same compilation unit.

Thanks, I pushed this fix:

verify: fix bug when gnulib <assert.h> is also included
* lib/verify.h (verify, verify_true): Define if _GL_VERIFY_H
is defined, not if _GL_STATIC_ASSERT_H is not defined.
Perhaps there's a better way, but this fixes the immediate problem.
Problem reported by Bruno Haible in
diff --git a/lib/verify.h b/lib/verify.h
index e5065ff..3294b30 100644
--- a/lib/verify.h
+++ b/lib/verify.h
@@ -204,7 +204,9 @@ template <int w>
 #  if !defined _GL_HAVE_STATIC_ASSERT && !defined static_assert
 #   define static_assert _Static_assert /* Draft C1X requires this #define.  */
 #  endif
-# else
+# endif
+# ifdef _GL_VERIFY_H

 /* Each of these macros verifies that its argument R is nonzero.  To
    be portable, R should be an integer constant expression.  Unlike

reply via email to

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