2 dnl Copyright (C) 2011-2020 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
9 AC_DEFUN([gl_ASSERT_H],
12 AC_CACHE_CHECK([for static_assert], [gl_cv_static_assert],
16 static_assert (2 + 2 == 4, "arithmetic doesn't work");
17 static_assert (2 + 2 == 4);
20 static_assert (sizeof (char) == 1, "sizeof doesn't work");
21 static_assert (sizeof (char) == 1);
23 [gl_cv_static_assert=yes],
24 [gl_cv_static_assert=no])])
25 if test $gl_cv_static_assert = no; then
27 gl_NEXT_HEADERS([assert.h])
30 AM_CONDITIONAL([GL_GENERATE_ASSERT_H], [test -n "$ASSERT_H"])