2 dnl Copyright (C) 2011-2018 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");
19 static_assert (sizeof (char) == 1, "sizeof doesn't work");
21 [gl_cv_static_assert=yes],
22 [gl_cv_static_assert=no])])
23 if test $gl_cv_static_assert = no; then
25 gl_NEXT_HEADERS([assert.h])
28 AM_CONDITIONAL([GL_GENERATE_ASSERT_H], [test -n "$ASSERT_H"])