Commit ec075c6e authored by Michael Graff's avatar Michael Graff
Browse files

revert assertions.h, and add UNUSED() to util.h

parent 78fed22a
......@@ -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))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment