]>
git.proxmox.com Git - mirror_frr.git/blob - lib/zassert.h
2 * This file is part of Quagga.
4 * Quagga is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2, or (at your option) any
9 * Quagga is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; see the file COPYING; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 #ifndef _QUAGGA_ASSERT_H
20 #define _QUAGGA_ASSERT_H
26 extern void _zlog_assert_failed(const char *assertion
, const char *file
,
27 unsigned int line
, const char *function
)
28 __attribute__((noreturn
));
30 #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
31 #define __ASSERT_FUNCTION __func__
32 #elif defined(__GNUC__)
33 #define __ASSERT_FUNCTION __FUNCTION__
35 #define __ASSERT_FUNCTION NULL
39 ((void)((EX) ? 0 : (_zlog_assert_failed(#EX, __FILE__, __LINE__, \
44 #define assert(EX) zassert(EX)
50 #endif /* _QUAGGA_ASSERT_H */