X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=lib%2Fzassert.h;h=e50a88f40781d85910ca8079e949ff2b25bb4169;hb=38e2ec77cd22e20bab1b829cbb111e437acd9602;hp=082ad678971ededdddf42de980810c1c9160c097;hpb=bac7b7b935162915bbefb7d01ce55eb364635c0b;p=mirror_frr.git diff --git a/lib/zassert.h b/lib/zassert.h index 082ad6789..e50a88f40 100644 --- a/lib/zassert.h +++ b/lib/zassert.h @@ -1,6 +1,4 @@ /* - * $Id: zassert.h,v 1.2 2004/12/03 18:01:04 ajs Exp $ - * * This file is part of Quagga. * * Quagga is free software; you can redistribute it and/or modify it @@ -21,9 +19,13 @@ #ifndef _QUAGGA_ASSERT_H #define _QUAGGA_ASSERT_H -extern void _zlog_assert_failed (const char *assertion, const char *file, - unsigned int line, const char *function) - __attribute__ ((noreturn)); +#ifdef __cplusplus +extern "C" { +#endif + +extern void _zlog_assert_failed(const char *assertion, const char *file, + unsigned int line, const char *function) + __attribute__((noreturn)); #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __ASSERT_FUNCTION __func__ @@ -33,11 +35,16 @@ extern void _zlog_assert_failed (const char *assertion, const char *file, #define __ASSERT_FUNCTION NULL #endif -#define zassert(EX) ((void)((EX) ? 0 : \ - (_zlog_assert_failed(#EX, __FILE__, __LINE__, \ - __ASSERT_FUNCTION), 0))) +#define zassert(EX) \ + ((void)((EX) ? 0 : (_zlog_assert_failed(#EX, __FILE__, __LINE__, \ + __ASSERT_FUNCTION), \ + 0))) #undef assert #define assert(EX) zassert(EX) +#ifdef __cplusplus +} +#endif + #endif /* _QUAGGA_ASSERT_H */