diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1996-10-19 10:02:54 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1996-10-19 10:02:54 +0000 |
commit | 13736c9983ff599650b38cda38a58999b53e9bf4 (patch) | |
tree | f3c156dde75bd26fd932e566a8b52aa7728e8ea5 /sys/arch/arc | |
parent | 37b6f04da92d0a9514e8cf8cb7e6496be490d9a3 (diff) |
__assert added, impl from netbsd, however put elsewhere. use it instead
of private versions (one even using the userland header) in if_sn.c
Diffstat (limited to 'sys/arch/arc')
-rw-r--r-- | sys/arch/arc/dev/if_sn.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/sys/arch/arc/dev/if_sn.c b/sys/arch/arc/dev/if_sn.c index f15ba5814a2..7ec82f8d391 100644 --- a/sys/arch/arc/dev/if_sn.c +++ b/sys/arch/arc/dev/if_sn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_sn.c,v 1.6 1996/10/12 00:50:43 deraadt Exp $ */ +/* $OpenBSD: if_sn.c,v 1.7 1996/10/19 10:02:51 niklas Exp $ */ /* * National Semiconductor SONIC Driver * Copyright (c) 1991 Algorithmics Ltd (http://www.algor.co.uk) @@ -113,16 +113,20 @@ struct cfdriver sn_cd = { NULL, "sn", DV_IFNET, NULL, 0 }; -#include <assert.h> -void -__assert(file, line, failedexpr) - const char *file, *failedexpr; - int line; -{ - (void)printf( - "assertion \"%s\" failed: file \"%s\", line %d\n", - failedexpr, file, line); -} +#undef assert +#undef _assert + +#ifdef NDEBUG +#define assert(e) ((void)0) +#define _assert(e) ((void)0) +#else +#define _assert(e) assert(e) +#ifdef __STDC__ +#define assert(e) ((e) ? (void)0 : __assert("sn ", __FILE__, __LINE__, #e)) +#else /* PCC */ +#define assert(e) ((e) ? (void)0 : __assert("sn "__FILE__, __LINE__, "e")) +#endif +#endif void m_check(m) |