X-Git-Url: https://jfr.im/git/solanum.git/blobdiff_plain/f3564f47f403549fbda0b27203882f24f8581604..b2ee72e4487d9ec90ff64f63d8f8c3974d96bc5c:/include/ircd_defs.h diff --git a/include/ircd_defs.h b/include/ircd_defs.h index 4e9ea037..cea850ce 100644 --- a/include/ircd_defs.h +++ b/include/ircd_defs.h @@ -64,6 +64,8 @@ #define MIN(a, b) ((a) < (b) ? (a) : (b)) #endif +#define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0])) + #define HOSTLEN 63 /* Length of hostname. Updated to */ /* comply with RFC1123 */ @@ -95,7 +97,9 @@ #define EXT_BUFSIZE (TAGSLEN + DATALEN + 1) #define OPERNICKLEN (NICKLEN*2) /* Length of OPERNICKs. */ -#define USERHOST_REPLYLEN (NICKLEN+HOSTLEN+USERLEN+5) +#define NAMELEN (MAX(NICKLEN, HOSTLEN)) + +#define USERHOST_REPLYLEN (NAMELEN+HOSTLEN+USERLEN+5) #define MAX_DATE_STRING 32 /* maximum string length for a date string */ #define HELPLEN 400 @@ -107,24 +111,11 @@ #define CLIENT_PARSE_ERROR -1 #define CLIENT_OK 1 -#ifdef RB_IPV6 #ifndef AF_INET6 #error "AF_INET6 not defined" #endif - -#else /* #ifdef RB_IPV6 */ - -#ifndef AF_INET6 -#define AF_INET6 AF_MAX /* Dummy AF_INET6 declaration */ -#endif -#endif /* #ifdef RB_IPV6 */ - -#ifdef RB_IPV6 #define PATRICIA_BITS 128 -#else -#define PATRICIA_BITS 32 -#endif /* Read buffer size */ #define READBUF_SIZE 16384