From 4781f2d7efe971277d9c2fbb0755c465fadcdcf8 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 13 Oct 2015 03:40:15 +0200 Subject: inclusion guard for assert.h do not guard definitions that depend on NDEBUG being unset MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- include/assert.h | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'include') diff --git a/include/assert.h b/include/assert.h index bf99258..9dd8f4c 100644 --- a/include/assert.h +++ b/include/assert.h @@ -15,8 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#ifndef _ASSERT_H -#define _ASSERT_H #include #include @@ -46,16 +44,6 @@ #endif -/** - * A compile-time error should occur if the expression - * evaluates to zero. - * - * @param expression:scalar The expression to evaluate. - * @param message:const char* The message to print on error. - */ -#define static_assert _Static_assert - - #if defined(__SLIBC_SOURCE) || defined(__GNU_SOURCE) /** * Unless `NDEBUG` is defined, print an error message @@ -78,6 +66,21 @@ +#ifndef _ASSERT_H +#define _ASSERT_H + + + +/** + * A compile-time error should occur if the expression + * evaluates to zero. + * + * @param expression:scalar The expression to evaluate. + * @param message:const char* The message to print on error. + */ +#define static_assert _Static_assert + + /** * The function that is called if an assertion fails. * -- cgit v1.2.3-70-g09d2