assert.h: remove custom macro definitions for lint mode

In lint mode, 'assert(cond)' expanded to nothing.  This broke code like
sqlite that assumes 'assert(cond)' expands to an expression that can be
used as operand of the comma operator, as in 'return assert(i > 0), i'.
This commit is contained in:
rillig 2023-09-12 22:08:24 +00:00
parent 401e0ef38d
commit ac66081df5
1 changed files with 4 additions and 14 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: assert.h,v 1.25 2020/04/17 15:22:34 kamil Exp $ */
/* $NetBSD: assert.h,v 1.26 2023/09/12 22:08:24 rillig Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -48,11 +48,7 @@
#undef assert
#ifdef NDEBUG
# ifndef __lint__
# define assert(e) (__static_cast(void,0))
# else /* !__lint__ */
# define assert(e)
# endif /* __lint__ */
#else /* !NDEBUG */
# if __STDC__
# define assert(e) \
@ -67,11 +63,7 @@
#undef _DIAGASSERT
#if !defined(_DIAGNOSTIC)
# if !defined(__lint__)
# define _DIAGASSERT(e) (__static_cast(void,0))
# else /* !__lint__ */
# define _DIAGASSERT(e)
# endif /* __lint__ */
#else /* _DIAGNOSTIC */
# if __STDC__
# define _DIAGASSERT(e) \
@ -85,9 +77,7 @@
#endif /* _DIAGNOSTIC */
#if defined(__lint__)
#define __assert_function__ (__static_cast(const void *,0))
#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#define __assert_function__ __func__
#elif __GNUC_PREREQ__(2, 6)
#define __assert_function__ __PRETTY_FUNCTION__