hirc

IRC client
Log | Files | Refs

commit b627d825995b92ace3b378c86f3513ddb1bb0764
parent bc94d15c47fa0d0c2e55b0857280173f2a96d108
Author: hhvn <dev@hhvn.uk>
Date:   Sun,  8 May 2022 11:49:21 +0100

Use custom assert()

Diffstat:
Msrc/config.c | 1-
Msrc/hirc.h | 1+
Msrc/main.c | 1-
Msrc/serv.c | 1-
4 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/config.c b/src/config.c @@ -21,7 +21,6 @@ #include <string.h> #include <stdlib.h> #include <errno.h> -#include <assert.h> #include <limits.h> #include "hirc.h" diff --git a/src/hirc.h b/src/hirc.h @@ -29,6 +29,7 @@ /* real maximum = HIST_MAX * (channels + servers + queries) */ #define CONSTLEN(str) ((size_t)((sizeof(str) - sizeof(str[0])) / sizeof(str[0]))) /* compile-time char/wchar_t literals */ +#define assert(x) ((void)((x) || (die(1, "assertion '%s' failed at %s:%d in %s()\n", #x, __FILE__, __LINE__, __func__),0))) /* strlcpy/wcslcpy.c */ #ifdef HIRC_STRLCPY diff --git a/src/main.c b/src/main.c @@ -27,7 +27,6 @@ #include <unistd.h> #include <stdarg.h> #include <signal.h> -#include <assert.h> #include <poll.h> #include "hirc.h" diff --git a/src/serv.c b/src/serv.c @@ -20,7 +20,6 @@ #include <stdlib.h> #include <string.h> #include <unistd.h> -#include <assert.h> #include <errno.h> #include <netdb.h> #include <sys/types.h>