summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/charset.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/charset.h b/src/charset.h
index d385e05bbb6..2cc0f0ce017 100644
--- a/src/charset.h
+++ b/src/charset.h
@@ -839,4 +839,12 @@ extern Lisp_Object Vauto_fill_chars;
while (i--) *from_p++ = *to_p++; \
} while (0)
+/* Length of C in bytes. */
+
+#define CHAR_LEN(C) \
+ (CHAR_CHARSET ((C)) == CHARSET_COMPOSITION \
+ ? cmpchar_table[COMPOSITE_CHAR_ID ((C))]->len \
+ : CHARSET_BYTES (CHAR_CHARSET ((C))))
+
+
#endif /* _CHARSET_H */