(INC_TEXT_POS, DEC_TEXT_POS): Add parameter MULTIBYTE_P.
authorGerd Moellmann <gerd@gnu.org>
Mon, 27 Mar 2000 16:02:34 +0000 (16:02 +0000)
committerGerd Moellmann <gerd@gnu.org>
Mon, 27 Mar 2000 16:02:34 +0000 (16:02 +0000)
src/dispextern.h

index 355454a..76578b8 100644 (file)
@@ -130,21 +130,27 @@ struct text_pos
 
 /* Increment text position POS.  */
 
-#define INC_TEXT_POS(POS)                      \
+#define INC_TEXT_POS(POS, MULTIBYTE_P)         \
      do                                                \
        {                                       \
         ++(POS).charpos;                       \
-        INC_POS ((POS).bytepos);               \
+         if (MULTIBYTE_P)                      \
+          INC_POS ((POS).bytepos);             \
+        else                                   \
+          ++(POS).bytepos;                     \
        }                                       \
      while (0)
 
 /* Decrement text position POS.  */
 
-#define DEC_TEXT_POS(POS)                      \
+#define DEC_TEXT_POS(POS, MULTIBYTE_P)         \
      do                                                \
        {                                       \
         --(POS).charpos;                       \
-        DEC_POS ((POS).bytepos);               \
+         if (MULTIBYTE_P)                      \
+          DEC_POS ((POS).bytepos);             \
+        else                                   \
+          --(POS).bytepos;                     \
        }                                       \
      while (0)