Mirror of strace – the linux syscall tracer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

static_assert.h 616B

1234567891011121314151617181920212223242526272829
  1. /*
  2. * Copyright (c) 2018 Dmitry V. Levin <ldv@altlinux.org>
  3. * All rights reserved.
  4. *
  5. * SPDX-License-Identifier: LGPL-2.1-or-later
  6. */
  7. #ifndef STRACE_STATIC_ASSERT_H
  8. # define STRACE_STATIC_ASSERT_H
  9. # include "assert.h"
  10. # if defined HAVE_STATIC_ASSERT
  11. /* static_assert is already available */
  12. # elif defined HAVE__STATIC_ASSERT
  13. # undef static_assert
  14. # define static_assert _Static_assert
  15. # else /* !HAVE_STATIC_ASSERT && !HAVE__STATIC_ASSERT */
  16. # define static_assert(expr, message) \
  17. extern int (*strace_static_assert(int))[sizeof(int[2 * !!(expr) - 1])]
  18. # endif
  19. #endif /* !STRACE_STATIC_ASSERT_H */