File: static_assert.h

package info (click to toggle)
strace 4.26-0.2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 35,988 kB
  • sloc: ansic: 95,598; sh: 7,155; makefile: 2,489; awk: 335; perl: 267; sed: 6
file content (29 lines) | stat: -rwxr-xr-x 607 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
 * Copyright (c) 2018 Dmitry V. Levin <ldv@altlinux.org>
 * All rights reserved.
 *
 * SPDX-License-Identifier: LGPL-2.1-or-later
 */

#ifndef STRACE_STATIC_ASSERT_H
#define STRACE_STATIC_ASSERT_H

#include "assert.h"

#if defined HAVE_STATIC_ASSERT

/* static_assert is already available */

#elif defined HAVE__STATIC_ASSERT

# undef static_assert
# define static_assert _Static_assert

#else /* !HAVE_STATIC_ASSERT && !HAVE__STATIC_ASSERT */

# define static_assert(expr, message) \
	extern int (*strace_static_assert(int))[sizeof(int[2 * !!(expr) - 1])]

#endif

#endif /* !STRACE_STATIC_ASSERT_H */