mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-13 20:59:59 -04:00
revert assertions.h, and add UNUSED() to util.h
This commit is contained in:
parent
78fed22afc
commit
ec075c6efb
2 changed files with 16 additions and 7 deletions
|
|
@ -16,7 +16,7 @@
|
|||
*/
|
||||
|
||||
/*
|
||||
* $Id: assertions.h,v 1.5 1999/12/15 01:48:46 explorer Exp $
|
||||
* $Id: assertions.h,v 1.6 1999/12/16 22:42:04 explorer Exp $
|
||||
*/
|
||||
|
||||
#ifndef ISC_ASSERTIONS_H
|
||||
|
|
@ -24,8 +24,6 @@
|
|||
|
||||
#include <isc/lang.h>
|
||||
|
||||
#define UNUSED(x) (void)(x)
|
||||
|
||||
ISC_LANG_BEGINDECLS
|
||||
|
||||
typedef enum {
|
||||
|
|
@ -80,7 +78,7 @@ char *isc_assertion_typetotext(isc_assertiontype_t type);
|
|||
isc_assertiontype_require, \
|
||||
#cond), 0)))
|
||||
#else
|
||||
#define REQUIRE(cond) (UNUSED(0))
|
||||
#define REQUIRE(cond) ((void) 0)
|
||||
#endif /* CHECK_REQUIRE */
|
||||
|
||||
#if CHECK_ENSURE != 0
|
||||
|
|
@ -90,7 +88,7 @@ char *isc_assertion_typetotext(isc_assertiontype_t type);
|
|||
isc_assertiontype_ensure, \
|
||||
#cond), 0)))
|
||||
#else
|
||||
#define ENSURE(cond) (UNUSED(0))
|
||||
#define ENSURE(cond) ((void) 0)
|
||||
#endif /* CHECK_ENSURE */
|
||||
|
||||
#if CHECK_INSIST != 0
|
||||
|
|
@ -100,7 +98,7 @@ char *isc_assertion_typetotext(isc_assertiontype_t type);
|
|||
isc_assertiontype_insist, \
|
||||
#cond), 0)))
|
||||
#else
|
||||
#define INSIST(cond) (UNUSED(0))
|
||||
#define INSIST(cond) ((void) 0)
|
||||
#endif /* CHECK_INSIST */
|
||||
|
||||
#if CHECK_INVARIANT != 0
|
||||
|
|
@ -110,7 +108,7 @@ char *isc_assertion_typetotext(isc_assertiontype_t type);
|
|||
isc_assertiontype_invariant, \
|
||||
#cond), 0)))
|
||||
#else
|
||||
#define INVARIANT(cond) (UNUSED(0))
|
||||
#define INVARIANT(cond) ((void) 0)
|
||||
#endif /* CHECK_INVARIANT */
|
||||
|
||||
ISC_LANG_ENDDECLS
|
||||
|
|
|
|||
|
|
@ -35,6 +35,17 @@
|
|||
*** General Macros.
|
||||
***/
|
||||
|
||||
/*
|
||||
* Use this to hide unused function arguments.
|
||||
*
|
||||
* int
|
||||
* foo(char *bar)
|
||||
* {
|
||||
* UNUSED(bar);
|
||||
* }
|
||||
*/
|
||||
#define UNUSED(x) (void)(x)
|
||||
|
||||
#define ISC_MAX(a, b) ((a) > (b) ? (a) : (b))
|
||||
#define ISC_MIN(a, b) ((a) < (b) ? (a) : (b))
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue