From: Nick Bowler Date: Tue, 30 May 2023 00:35:15 +0000 (-0400) Subject: copysym: Avoid including xtra.h. X-Git-Url: https://git.draconx.ca/gitweb/dxcommon.git/commitdiff_plain/0ca8e614dc99eae0e638224aafee8cf090594429 copysym: Avoid including xtra.h. Using the xtra.h header just for the arraysize macro is just added complexity for downstream projects (who then need to ensure the xtra.h header is distributed even if they don't otherwise need it). --- diff --git a/src/copysym.c b/src/copysym.c index 8ecace7..7de9e98 100644 --- a/src/copysym.c +++ b/src/copysym.c @@ -17,7 +17,8 @@ #include #include #include -#include "xtra.h" + +#define ARRAYSIZE(x) (sizeof (x) / sizeof (x)[0]) static int compar_5arr(const void *key, const void *elem_) { @@ -130,7 +131,7 @@ const char *copyright_symbol(const char *charset) if (!charset) goto no_conv; - m1 = bsearch(charset, t1, XTRA_ARRAYSIZE(t1), sizeof *t1, compar_5arr); + m1 = bsearch(charset, t1, ARRAYSIZE(t1), sizeof *t1, compar_5arr); if (!m1) goto no_conv; charset += 5;