diff options
| author | bjh21 <bjh21@NetBSD.org> | 2003-06-05 17:27:14 +0000 |
|---|---|---|
| committer | bjh21 <bjh21@NetBSD.org> | 2003-06-05 17:27:14 +0000 |
| commit | 37a103a1faab6376edcd23b0455b2cf16b79e809 (patch) | |
| tree | 0af840bb40610ff00337207ba1925a44d540c57a /include/assert.h | |
| parent | 3a7267eb8ab23e82a8a6ec9f4f0fd6df43a3de63 (diff) | |
Namespace cleanup: _assert is in the application's namespace, and thus should
only be exposed if _NETBSD_SOURCE is defined. To make life less complicated,
define _assert() in terms of assert(), since they always seem to have identical
definitions.
_assert() was removed back in 1993, but got reinstated with the 4.4Lite
import. Maybe it should go again. Nothing in the tree uses it.
Diffstat (limited to 'include/assert.h')
| -rw-r--r-- | include/assert.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/include/assert.h b/include/assert.h index ada4f2ca3dc..9e2bbe93422 100644 --- a/include/assert.h +++ b/include/assert.h @@ -1,4 +1,4 @@ -/* $NetBSD: assert.h,v 1.12 2001/05/06 15:31:09 kleink Exp $ */ +/* $NetBSD: assert.h,v 1.13 2003/06/05 17:27:14 bjh21 Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -46,20 +46,18 @@ */ #include <sys/cdefs.h> +#include <sys/featuretest.h> #undef assert -#undef _assert #ifdef NDEBUG # ifndef lint # define assert(e) (__static_cast(void,0)) -# define _assert(e) (__static_cast(void,0)) +# endif # else /* !lint */ # define assert(e) -# define _assert(e) # endif /* lint */ #else /* !NDEBUG */ -# define _assert(e) assert(e) # if __STDC__ # define assert(e) \ ((e) ? __static_cast(void,0) : __assert13(__FILE__, __LINE__, \ @@ -71,6 +69,11 @@ # endif /* !__STDC__ */ #endif /* NDEBUG */ +#if defined(_NETBSD_SOURCE) +# undef _assert +# define _assert(e) assert(e) +#endif + #undef _DIAGASSERT #if !defined(_DIAGNOSTIC) # if !defined(lint) |
