| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
* m4/assert_h.m4 (gl_ASSERT_H): Also test for static_assert
keyword a la C23, and define HAVE_C_STATIC_ASSERT if so.
If not, arrange for config.h to #define static_assert
by including <assert.h>, and then do "#undef assert"
so that the assert macro still needs an explicit include.
This should be safe even on very old hosts, as assert.h
has been re-includable for decades.
* tests/tests-assert.c: New test.
* modules/assert-h-tests (Files, Makefile.am): Add it.
|
| |
|
|
|
|
|
|
| |
This is a clerical change that mostly changes http: to https: in URLs
where either will work. It also updates some URLs that have moved,
removes some URLs that no longer work, and fixes related text.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
C2X and C++17 finally added support for a simple, single-argument
‘static_assert’ that implements what the Gnulib ‘verify’ macro was
doing back in 2005. Implement static_assert on older platforms.
The only remaining advantage of ‘verify’ is a shorter name.
* doc/posix-headers/assert.texi (assert.h):
* doc/verify.texi (Compile-time Assertions):
Modernize for C2X and C++17.
* lib/verify.h (_GL_HAVE__STATIC_ASSERT1, _GL_HAVE_STATIC_ASSERT1):
New macros.
(_GL_HAVE__STATIC_ASSERT): Remove.
(_GL_HAVE__STATIC_ASSERT): Rely more heavily on __STDC_VERSION__.
(_GL_VERIFY_TRUE, _GL_VERIFY_TYPE): Remove 2nd arg, the diagnostic
string. All callers changed.
(_GL_VERIFY): Require 3 or more args, of which only the first 2
are used. All callers changed.
(_Static_assert): Allow either 1 or 2 args, and define if
!_GL_HAVE__STATIC_ASSERT1 instead of defining if
!_GL_HAVE__STATIC_ASSERT.
(static_assert): Define if !_GL_HAVE_STATIC_ASSERT1 instead
of defining if !_GL_HAVE_STATIC_ASSERT.
(verify_expr, verify): Don’t bother trying to copy the expression
into the diagnostic, since 1-argument static_assert doesn’t.
(verify): Prefer 1-argument _Static_assert if it works.
* m4/assert_h.m4 (gl_ASSERT_H): Check for 1-argument static_assert.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib/assert.in.h, m4/assert_h.m4, modules/assert-h: New files.
* lib/verify.h: Revamp so that this can be copied into assert.h,
while retaining the ability to use it standalone as before.
Rename private identifiers so as not to encroach on the
standard C namespace, since this is now used by assert.h.
(_GL_VERIFY_TYPE): New macro, factoring out differing parts of
the old verify_true.
(_GL_VERIFY_TRUE): New macro, with much of the contents of
the old verify_true. Use _GL_VERIFY_TYPE.
(_GL_VERIFY): New macro, with much of the contents of the old verify.
(static_assert): New macro, if _GL_STATIC_ASSERT_H
is defined and static_assert is not; _GL_STATIC_ASSERT_H is
defined when this file is copied into the replacement assert.h.
(_Static_assert): New macro, if _GL_STATIC_ASSERT_H is defined
and _Static_assert is not built in.
(verify_true, verify): Define only if _GL_STATIC_ASSERT_H is not
defined, and use the new macros mentioned above.
* doc/posix-headers/assert.texi: Document this.
|
|
|
|
|
| |
* doc/posix-headers/*.texi [except ucontext.texi, sys_timeb.texi]:
Update URL of POSIX specification.
|
| |
|
|
|