From 28ca3ab57366a041138756872c2020aca0b98ec8 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Mon, 14 Jun 2021 06:04:44 -0600 Subject: utf8.h: Add symbol for easing EBCDIC handling This is then used in regcomp.c to avoid an #ifdef EBCDIC --- utf8.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'utf8.h') diff --git a/utf8.h b/utf8.h index 4a4525ef11..1cb0b6855e 100644 --- a/utf8.h +++ b/utf8.h @@ -278,6 +278,12 @@ are in the character. */ #endif /* EBCDIC vs ASCII */ +/* It turns out that in a number of cases, that handling ASCII vs EBCDIC is a + * matter of being off-by-one. So this is a convenience macro, used to avoid + * some #ifdefs. */ +#define ONE_IF_EBCDIC_ZERO_IF_NOT \ + (UTF_CONTINUATION_BYTE_INFO_BITS == UTF_EBCDIC_CONTINUATION_BYTE_INFO_BITS) + /* Since the significant bits in a continuation byte are stored in the * least-significant positions, we often find ourselves shifting by that * amount. This is a clearer name in such situations */ -- cgit v1.2.1