diff options
author | 2020-02-26 14:23:15 +0000 | |
---|---|---|
committer | 2020-02-26 14:23:15 +0000 | |
commit | e1bcc96db2d520dc36554d8fc038526d129fdc07 (patch) | |
tree | 1ec7c42cff08a39d84ab464898f0cfc429eb0588 /sys/lib/libkern/libkern.h | |
parent | Add sndioctl utility to control audio parameters exposed by sndiod. (diff) | |
download | wireguard-openbsd-e1bcc96db2d520dc36554d8fc038526d129fdc07.tar.xz wireguard-openbsd-e1bcc96db2d520dc36554d8fc038526d129fdc07.zip |
Remove non-__STDC__ assert macros from <lib/libkern/libkern.h>.
The macros are defined in a part of the header where a C compiler
is required. In addition, the macros expand to C code, so it looks
unnecessary to define the asserts with traditional cpp in mind.
OK cheloha@, mpi@
Diffstat (limited to 'sys/lib/libkern/libkern.h')
-rw-r--r-- | sys/lib/libkern/libkern.h | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/sys/lib/libkern/libkern.h b/sys/lib/libkern/libkern.h index db020a8ed03..597219a5863 100644 --- a/sys/lib/libkern/libkern.h +++ b/sys/lib/libkern/libkern.h @@ -1,4 +1,4 @@ -/* $OpenBSD: libkern.h,v 1.35 2018/04/25 11:15:58 dlg Exp $ */ +/* $OpenBSD: libkern.h,v 1.36 2020/02/26 14:23:15 visa Exp $ */ /* $NetBSD: libkern.h,v 1.7 1996/03/14 18:52:08 christos Exp $ */ /*- @@ -105,13 +105,8 @@ abs(int j) #ifdef NDEBUG /* tradition! */ #define assert(e) ((void)0) #else -#ifdef __STDC__ #define assert(e) ((e) ? (void)0 : \ __assert("", __FILE__, __LINE__, #e)) -#else -#define assert(e) ((e) ? (void)0 : \ - __assert("", __FILE__, __LINE__, "e")) -#endif #endif #define __KASSERTSTR "kernel %sassertion \"%s\" failed: file \"%s\", line %d" @@ -120,38 +115,22 @@ abs(int j) #define KASSERTMSG(e, msg, ...) ((void)0) #define KASSERT(e) ((void)0) #else -#ifdef __STDC__ #define KASSERTMSG(e, msg, ...) ((e) ? (void)0 : \ panic(__KASSERTSTR " " msg, "diagnostic ", #e, \ __FILE__, __LINE__, ## __VA_ARGS__)) #define KASSERT(e) ((e) ? (void)0 : \ __assert("diagnostic ", __FILE__, __LINE__, #e)) -#else -#define KASSERTMSG(e, msg, ...) ((e) ? (void)0 : \ - panic(__KASSERTSTR " " msg, "diagnostic ", "e", \ - __FILE__, __LINE__, ## __VA_ARGS__)) -#define KASSERT(e) ((e) ? (void)0 : \ - __assert("diagnostic ", __FILE__, __LINE__, "e")) -#endif #endif #ifndef DEBUG #define KDASSERTMSG(e, msg, ...) ((void)0) #define KDASSERT(e) ((void)0) #else -#ifdef __STDC__ #define KDASSERTMSG(e, msg, ...) ((e) ? (void)0 : \ panic(__KASSERTSTR " " msg, "debugging ", #e, \ __FILE__, __LINE__, ## __VA_ARGS__)) #define KDASSERT(e) ((e) ? (void)0 : \ __assert("debugging ", __FILE__, __LINE__, #e)) -#else -#define KDASSERTMSG(e, msg, ...) ((e) ? (void)0 : \ - panic(__KASSERTSTR " " msg, "debugging ", "e", \ - __FILE__, __LINE__, ## __VA_ARGS__)) -#define KDASSERT(e) ((e) ? (void)0 : \ - __assert("debugging ", __FILE__, __LINE__, "e")) -#endif #endif #define CTASSERT(x) extern char _ctassert[(x) ? 1 : -1 ] \ |