X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fverify.h;h=9a8caad001d9d76148ca624633f9b8a4e8f4b0af;hb=fac94349f25305566277d15b965fa8f4efe66613;hp=760486072ec99639d3fce06dc713d7682ae9cae9;hpb=606b7ac5defd3ee289dee9cf0f5d23fb0ccd3887;p=gnulib.git diff --git a/lib/verify.h b/lib/verify.h index 760486072..9a8caad00 100644 --- a/lib/verify.h +++ b/lib/verify.h @@ -209,7 +209,7 @@ template # endif # endif -# ifdef _GL_VERIFY_H +/* @assert.h omit start@ */ /* Each of these macros verifies that its argument R is nonzero. To be portable, R should be an integer constant expression. Unlike @@ -221,15 +221,23 @@ template contexts, e.g., the top level. */ /* Verify requirement R at compile-time, as an integer constant expression. - Return 1. */ + Return 1. This is equivalent to verify_expr (R, 1). -# define verify_true(R) _GL_VERIFY_TRUE (R, "verify_true (" #R ")") + verify_true is obsolescent; please use verify_expr instead. */ + +# define verify_true(R) _GL_VERIFY_TRUE (R, "verify_true (" #R ")") + +/* Verify requirement R at compile-time. Return the value of the + expression E. */ + +# define verify_expr(R, E) \ + (_GL_VERIFY_TRUE (R, "verify_expr (" #R ", " #E ")") ? (E) : (E)) /* Verify requirement R at compile-time, as a declaration without a trailing ';'. */ -# define verify(R) _GL_VERIFY (R, "verify (" #R ")") +# define verify(R) _GL_VERIFY (R, "verify (" #R ")") -# endif +/* @assert.h omit end@ */ #endif