changeset 15450:bb421f682528 v8.1.0733

patch 8.1.0733: too many #ifdefs for the multi-byte feature commit https://github.com/vim/vim/commit/2be7cb73f66cf69659195d9a8ad4beaa359f2865 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jan 12 16:10:51 2019 +0100 patch 8.1.0733: too many #ifdefs for the multi-byte feature Problem: Too many #ifdefs for the multi-byte feature. Solution: Tentatively always enable the multi-byte feature. If you have a problem with this, please discuss on the Vim maillist.
author Bram Moolenaar <Bram@vim.org>
date Sat, 12 Jan 2019 16:15:04 +0100
parents 869f88d11e31
children 8ab318043c9f
files src/Make_bc5.mak src/Make_cyg_ming.mak src/Make_mvc.mak src/Makefile src/auto/configure src/configure.ac src/feature.h src/version.c
diffstat 8 files changed, 27 insertions(+), 96 deletions(-) [+]
line wrap: on
line diff
--- a/src/Make_bc5.mak
+++ b/src/Make_bc5.mak
@@ -61,10 +61,6 @@
 #		of Ruby will cause a compile error on these systems.
 #   RUBY_VER_LONG  same, but in format with dot. (1.6)
 #   DYNAMIC_RUBY no or yes: use yes to load the Ruby DLL dynamically (no)
-# MBYTE		no or yes: set to yes for multi-byte support (yes)
-#		NOTE: multi-byte support is broken in the Borland libraries,
-#		not everything will work properly!  Esp. handling multi-byte
-#		file names.
 # IME		no or yes: set to yes for multi-byte IME support (yes)
 #   DYNAMIC_IME no or yes: set to yes to load imm32.dll dynamically (yes)
 # GETTEXT	no or yes: set to yes for multi-language support (yes)
@@ -104,11 +100,6 @@ BOR = c:\bc5
 GUI = yes
 !endif
 
-### MBYTE: yes for multibyte support, no to disable it.
-!if ("$(MBYTE)"=="")
-MBYTE = yes
-!endif
-
 ### IME: yes for multibyte support, no to disable it.
 !if ("$(IME)"=="")
 IME = yes
@@ -216,7 +207,6 @@ ALIGN = 4
 	("$(RUBY)"=="") && \
 	("$(ICONV)"!="yes") && \
 	("$(IME)"!="yes") && \
-	("$(MBYTE)"!="yes") && \
 	("$(XPM)"=="")
 FASTCALL = yes
 !endif
@@ -397,9 +387,6 @@ DEFINES=$(DEFINES) -DDEBUG -D_DEBUG
 DEFINES = $(DEFINES) -DFEAT_OLE
 !endif
 #
-!if ("$(MBYTE)"=="yes")
-MBDEFINES = $(MBDEFINES) -DFEAT_MBYTE
-!endif
 !if ("$(IME)"=="yes")
 MBDEFINES = $(MBDEFINES) -DFEAT_MBYTE_IME
 !if ("$(DYNAMIC_IME)" == "yes")
@@ -687,9 +674,6 @@ MSG = $(MSG) VIMDLL
 !if ("$(FASTCALL)"=="yes")
 MSG = $(MSG) FASTCALL
 !endif
-!if ("$(MBYTE)"=="yes")
-MSG = $(MSG) MBYTE
-!endif
 !if ("$(IME)"=="yes")
 MSG = $(MSG) IME
 ! if "$(DYNAMIC_IME)" == "yes"
--- a/src/Make_cyg_ming.mak
+++ b/src/Make_cyg_ming.mak
@@ -65,9 +65,6 @@ CROSS=no
 ICONV=yes
 GETTEXT=yes
 
-# Set to yes to include multibyte support.
-MBYTE=yes
-
 # Set to yes to include IME support.
 IME=yes
 DYNAMIC_IME=yes
@@ -911,10 +908,6 @@ OBJ += $(OUTDIR)/if_ole.o
 USE_STDCPLUS = yes
 endif
 
-ifeq (yes, $(MBYTE))
-DEFINES += -DFEAT_MBYTE
-endif
-
 ifeq (yes, $(IME))
 DEFINES += -DFEAT_MBYTE_IME
 ifeq (yes, $(DYNAMIC_IME))
--- a/src/Make_mvc.mak
+++ b/src/Make_mvc.mak
@@ -26,15 +26,13 @@
 #	GUI interface: GUI=yes (default is no)
 #
 #	GUI with DirectWrite (DirectX): DIRECTX=yes
-#	  (default is yes if GUI=yes, requires GUI=yes and MBYTE=yes)
+#	  (default is yes if GUI=yes, requires GUI=yes)
 #
 #	Color emoji support: COLOR_EMOJI=yes
 #	  (default is yes if DIRECTX=yes, requires WinSDK 8.1 or later.)
 #
 #	OLE interface: OLE=yes (usually with GUI=yes)
 #
-#	Multibyte support: MBYTE=yes (default is yes for NORMAL, BIG, HUGE)
-#
 #	IME support: IME=yes	(requires GUI=yes)
 #	  DYNAMIC_IME=[yes or no]  (to load the imm32.dll dynamically, default
 #	  is yes)
@@ -786,11 +784,6 @@ IME_LIB = imm32.lib
 !if "$(GIME)" == "yes"
 CFLAGS = $(CFLAGS) -DGLOBAL_IME
 OBJ = $(OBJ) $(OUTDIR)\dimm_i.obj $(OUTDIR)\glbl_ime.obj
-MBYTE = yes
-!endif
-
-!if "$(MBYTE)" == "yes"
-CFLAGS = $(CFLAGS) -DFEAT_MBYTE
 !endif
 
 !if "$(GUI)" == "yes"
--- a/src/Makefile
+++ b/src/Makefile
@@ -493,11 +493,7 @@ CClink = $(CC)
 #CONF_OPT_TERMINAL = --disable-terminal
 
 # MULTIBYTE - To edit multi-byte characters.
-# Uncomment this when you want to edit a multibyte language.
-# It's automatically enabled with normal features, GTK or IME support.
-# Note: Compile on a machine where setlocale() actually works, otherwise the
-# configure tests may fail.
-#CONF_OPT_MULTIBYTE = --enable-multibyte
+# This is now always enabled.
 
 # When building with at least "big" features, right-left, Arabic and Farsi
 # features are enabled.  Use this to disable them.
--- a/src/auto/configure
+++ b/src/auto/configure
@@ -7959,7 +7959,7 @@ fi
 if test "${enable_multibyte+set}" = set; then :
   enableval=$enable_multibyte;
 else
-  enable_multibyte="no"
+  enable_multibyte="yes"
 fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_multibyte" >&5
@@ -7967,6 +7967,9 @@ fi
 if test "$enable_multibyte" = "yes"; then
   $as_echo "#define FEAT_MBYTE 1" >>confdefs.h
 
+else
+  as_fn_error $? "The multi-byte feature can no longer be disabled. If you have
+		a problem with this, discuss on the Vim mailing list." "$LINENO" 5
 fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking --disable-rightleft argument" >&5
@@ -14813,28 +14816,13 @@ if test "$MACOS_X" = "yes"; then
     if test "$features" = "tiny"; then
             OS_EXTRA_SRC=`echo "$OS_EXTRA_SRC" | sed -e 's+os_macosx.m++'`
       OS_EXTRA_OBJ=`echo "$OS_EXTRA_OBJ" | sed -e 's+objects/os_macosx.o++'`
-      if test "$enable_multibyte" = "yes"; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, we need CoreServices" >&5
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, we need CoreServices" >&5
 $as_echo "yes, we need CoreServices" >&6; }
-        LIBS="$LIBS -framework CoreServices"
-      else
-                { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-        OS_EXTRA_SRC=`echo "$OS_EXTRA_SRC" | sed -e 's+os_mac_conv.c++'`
-        OS_EXTRA_OBJ=`echo "$OS_EXTRA_OBJ" | sed -e 's+objects/os_mac_conv.o++'`
-        CPPFLAGS=`echo "$CPPFLAGS" | sed -e 's+-DMACOS_X_DARWIN++'`
-      fi
+      LIBS="$LIBS -framework CoreServices"
     else
       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, we need AppKit" >&5
 $as_echo "yes, we need AppKit" >&6; }
       LIBS="$LIBS -framework AppKit"
-      if test "$features" = "small" -a "$enable_multibyte" = "no"; then
-                                { $as_echo "$as_me:${as_lineno-$LINENO}: +multi_byte will be set in favor of +clipboard" >&5
-$as_echo "$as_me: +multi_byte will be set in favor of +clipboard" >&6;}
-        enable_multibyte=yes
-        $as_echo "#define FEAT_MBYTE 1" >>confdefs.h
-
-      fi
     fi
   else
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
--- a/src/configure.ac
+++ b/src/configure.ac
@@ -2138,10 +2138,13 @@ fi
 AC_MSG_CHECKING(--enable-multibyte argument)
 AC_ARG_ENABLE(multibyte,
 	[  --enable-multibyte      Include multibyte editing support.], ,
-	[enable_multibyte="no"])
+	[enable_multibyte="yes"])
 AC_MSG_RESULT($enable_multibyte)
 if test "$enable_multibyte" = "yes"; then
   AC_DEFINE(FEAT_MBYTE)
+else
+  AC_MSG_ERROR([The multi-byte feature can no longer be disabled. If you have
+		a problem with this, discuss on the Vim mailing list.])
 fi
 
 dnl Right-to-Left language support for Vim will be included with big features,
@@ -4416,27 +4419,11 @@ if test "$MACOS_X" = "yes"; then
       dnl Since no FEAT_CLIPBOARD, no longer need for os_macosx.m.
       OS_EXTRA_SRC=`echo "$OS_EXTRA_SRC" | sed -e 's+os_macosx.m++'`
       OS_EXTRA_OBJ=`echo "$OS_EXTRA_OBJ" | sed -e 's+objects/os_macosx.o++'`
-      if test "$enable_multibyte" = "yes"; then
-        AC_MSG_RESULT([yes, we need CoreServices])
-        LIBS="$LIBS -framework CoreServices"
-      else
-        dnl Since no FEAT_MBYTE, no longer need for os_mac_conv.c.
-        AC_MSG_RESULT([no])
-        OS_EXTRA_SRC=`echo "$OS_EXTRA_SRC" | sed -e 's+os_mac_conv.c++'`
-        OS_EXTRA_OBJ=`echo "$OS_EXTRA_OBJ" | sed -e 's+objects/os_mac_conv.o++'`
-        CPPFLAGS=`echo "$CPPFLAGS" | sed -e 's+-DMACOS_X_DARWIN++'`
-      fi
+      AC_MSG_RESULT([yes, we need CoreServices])
+      LIBS="$LIBS -framework CoreServices"
     else
       AC_MSG_RESULT([yes, we need AppKit])
       LIBS="$LIBS -framework AppKit"
-      if test "$features" = "small" -a "$enable_multibyte" = "no"; then
-        dnl Since FEAT_CLIPBOARD is to be defined in vim.h for FEAT_SMALL, define
-        dnl FEAT_MBYTE in order not to compromise the interoperability of the
-        dnl clipboard.
-        AC_MSG_NOTICE([+multi_byte will be set in favor of +clipboard])
-        enable_multibyte=yes
-        AC_DEFINE(FEAT_MBYTE)
-      fi
     fi
   else
     AC_MSG_RESULT([no])
--- a/src/feature.h
+++ b/src/feature.h
@@ -282,7 +282,7 @@
 
 /*
  * +arabic		Arabic keymap and shaping support.
- *			Requires FEAT_RIGHTLEFT and FEAT_MBYTE.
+ *			Requires FEAT_RIGHTLEFT
  *
  * Disabled for EBCDIC as it requires multibyte.
  */
@@ -597,16 +597,15 @@
 #endif
 
 /*
- * +multi_byte		Generic multi-byte character handling.  Doesn't work
- *			with 16 bit ints.  Required for GTK+ 2.
- *
- * Disabled for EBCDIC:
- * Multibyte support doesn't work on z/OS Unix currently.
+ * +multi_byte		Generic multi-byte character handling.
+ *			Now always enabled.
  */
-#if (defined(FEAT_NORMAL) || defined(FEAT_GUI_GTK) || defined(FEAT_ARABIC)) \
-	&& !defined(FEAT_MBYTE) && VIM_SIZEOF_INT >= 4 && !defined(EBCDIC)
+#if !defined(FEAT_MBYTE)
 # define FEAT_MBYTE
 #endif
+#if VIM_SIZEOF_INT < 4 && !defined(PROTO)
+	Error: Vim only works with 32 bit int or larger
+#endif
 
 /* Define this if you want to use 16 bit Unicode only, reduces memory used for
  * the screen structures. */
@@ -621,18 +620,8 @@
 /* #define FEAT_MBYTE_IME */
 # endif
 
-/* Input methods are only useful with +multi_byte. */
-#if (defined(FEAT_MBYTE_IME) || defined(FEAT_XIM)) && !defined(FEAT_MBYTE)
-# define FEAT_MBYTE
-#endif
-
-#if defined(FEAT_MBYTE) && VIM_SIZEOF_INT < 4 && !defined(PROTO)
-	Error: Can only handle multi-byte feature with 32 bit int or larger
-#endif
-
 /* Use iconv() when it's available. */
-#if defined(FEAT_MBYTE) && ((defined(HAVE_ICONV_H) && defined(HAVE_ICONV)) \
-		|| defined(DYNAMIC_ICONV))
+#if (defined(HAVE_ICONV_H) && defined(HAVE_ICONV)) || defined(DYNAMIC_ICONV)
 # define USE_ICONV
 #endif
 
@@ -669,7 +658,7 @@
  * +xfontset		X fontset support.  For outputting wide characters.
  */
 #ifndef FEAT_XFONTSET
-# if defined(FEAT_MBYTE) && defined(HAVE_X11) && !defined(FEAT_GUI_GTK)
+# if defined(HAVE_X11) && !defined(FEAT_GUI_GTK)
 #  define FEAT_XFONTSET
 # else
 /* #  define FEAT_XFONTSET */
@@ -1277,10 +1266,9 @@
 
 /*
  * +terminal		":terminal" command.  Runs a terminal in a window.
- *			requires +channel and +multibyte
+ *			requires +channel
  */
-#if defined(FEAT_TERMINAL) && \
-	!(defined(FEAT_JOB_CHANNEL) && defined(FEAT_MBYTE))
+#if defined(FEAT_TERMINAL) && !defined(FEAT_JOB_CHANNEL)
 # undef FEAT_TERMINAL
 #endif
 #if defined(FEAT_TERMINAL) && !defined(CURSOR_SHAPE)
--- a/src/version.c
+++ b/src/version.c
@@ -796,6 +796,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    733,
+/**/
     732,
 /**/
     731,