From 94ef4d69c135f6d58fe0a79bd6747c509931fc5c Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Thu, 17 Apr 2008 01:09:57 +0000 Subject: [PATCH] (STRING_SET_MULTIBYTE): New macro. --- src/lisp.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lisp.h b/src/lisp.h index c9a33307bc..ab07ea750f 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -725,6 +725,13 @@ extern int string_bytes P_ ((struct Lisp_String *)); (STR) = empty_unibyte_string; \ else XSTRING (STR)->size_byte = -1; } while (0) +/* Mark STR as a multibyte string. Assure that STR contains only + ASCII characters in advance. */ +#define STRING_SET_MULTIBYTE(STR) \ + do { if (EQ (STR, empty_unibyte_string)) \ + (STR) = empty_multibyte_string; \ + else XSTRING (STR)->size_byte = XSTRING (STR)->size; } while (0) + /* Get text properties. */ #define STRING_INTERVALS(STR) (XSTRING (STR)->intervals + 0) -- 2.20.1