To: vim_dev@googlegroups.com Subject: Patch 8.2.4694 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.4694 Problem: Avoidance of #elif causes more preproc nesting. Solution: Use #elif where it is useful. (Ozaki Kiichi, closes #10081) Files: src/option.c, src/optiondefs.h, src/optionstr.c, src/version.c *** ../vim-8.2.4693/src/option.c 2022-03-23 14:55:19.709745872 +0000 --- src/option.c 2022-04-05 14:13:53.521176160 +0100 *************** *** 198,213 **** if (options[opt_idx].def_val[VI_DEFAULT] == (char_u *)0L) #endif { ! #ifdef HAVE_AVAIL_MEM // Use amount of memory available at this moment. n = (mch_avail_mem(FALSE) >> 1); ! #else ! # ifdef HAVE_TOTAL_MEM // Use amount of memory available to Vim. n = (mch_total_mem(FALSE) >> 1); ! # else n = (0x7fffffff >> 11); - # endif #endif options[opt_idx].def_val[VI_DEFAULT] = (char_u *)n; opt_idx = findoption((char_u *)"maxmem"); --- 198,211 ---- if (options[opt_idx].def_val[VI_DEFAULT] == (char_u *)0L) #endif { ! #if defined(HAVE_AVAIL_MEM) // Use amount of memory available at this moment. n = (mch_avail_mem(FALSE) >> 1); ! #elif defined(HAVE_TOTAL_MEM) // Use amount of memory available to Vim. n = (mch_total_mem(FALSE) >> 1); ! #else n = (0x7fffffff >> 11); #endif options[opt_idx].def_val[VI_DEFAULT] = (char_u *)n; opt_idx = findoption((char_u *)"maxmem"); *************** *** 266,286 **** } #endif ! #if defined(FEAT_POSTSCRIPT) && (defined(MSWIN) || defined(VMS) || defined(MAC) || defined(hpux)) // Set print encoding on platforms that don't default to latin1 set_string_default("penc", # if defined(MSWIN) (char_u *)"cp1252" ! # else ! # ifdef VMS (char_u *)"dec-mcs" ! # else ! # ifdef MAC (char_u *)"mac-roman" ! # else // HPUX (char_u *)"hp-roman8" - # endif - # endif # endif ); #endif --- 264,281 ---- } #endif ! #if defined(FEAT_POSTSCRIPT) && \ ! (defined(MSWIN) || defined(VMS) || defined(MAC) || defined(hpux)) // Set print encoding on platforms that don't default to latin1 set_string_default("penc", # if defined(MSWIN) (char_u *)"cp1252" ! # elif defined(VMS) (char_u *)"dec-mcs" ! # elif defined(MAC) (char_u *)"mac-roman" ! # else // HPUX (char_u *)"hp-roman8" # endif ); #endif *************** *** 290,302 **** set_string_default("pexpr", # if defined(MSWIN) (char_u *)"system('copy' . ' ' . v:fname_in . (&printdevice == '' ? ' LPT1:' : (' \"' . &printdevice . '\"'))) . delete(v:fname_in)" ! # else ! # ifdef VMS (char_u *)"system('print/delete' . (&printdevice == '' ? '' : ' /queue=' . &printdevice) . ' ' . v:fname_in)" ! # else (char_u *)"system('lpr' . (&printdevice == '' ? '' : ' -P' . &printdevice) . ' ' . v:fname_in) . delete(v:fname_in) + v:shell_error" - # endif # endif ); #endif --- 285,295 ---- set_string_default("pexpr", # if defined(MSWIN) (char_u *)"system('copy' . ' ' . v:fname_in . (&printdevice == '' ? ' LPT1:' : (' \"' . &printdevice . '\"'))) . delete(v:fname_in)" ! # elif defined(VMS) (char_u *)"system('print/delete' . (&printdevice == '' ? '' : ' /queue=' . &printdevice) . ' ' . v:fname_in)" ! # else (char_u *)"system('lpr' . (&printdevice == '' ? '' : ' -P' . &printdevice) . ' ' . v:fname_in) . delete(v:fname_in) + v:shell_error" # endif ); #endif *************** *** 430,440 **** vim_setenv((char_u *)"LANG", (char_u *)buf); } } ! # else ! # ifdef MACOS_CONVERT // Moved to os_mac_conv.c to avoid dependency problems. mac_lang_init(); - # endif # endif # ifdef MSWIN --- 423,431 ---- vim_setenv((char_u *)"LANG", (char_u *)buf); } } ! # elif defined(MACOS_CONVERT) // Moved to os_mac_conv.c to avoid dependency problems. mac_lang_init(); # endif # ifdef MSWIN *** ../vim-8.2.4693/src/optiondefs.h 2022-04-03 15:46:57.389502603 +0100 --- src/optiondefs.h 2022-04-05 14:13:53.521176160 +0100 *************** *** 1148,1168 **** #ifdef FEAT_QUICKFIX (char_u *)&p_gp, PV_GP, { ! # ifdef MSWIN // may be changed to "grep -n" in os_win32.c (char_u *)"findstr /n", ! # else ! # ifdef UNIX // Add an extra file name so that grep will always // insert a file name in the match line. (char_u *)"grep -n $* /dev/null", ! # else ! # ifdef VMS (char_u *)"SEARCH/NUMBERS ", ! # else (char_u *)"grep -n ", - # endif - # endif # endif (char_u *)0L} #else --- 1148,1164 ---- #ifdef FEAT_QUICKFIX (char_u *)&p_gp, PV_GP, { ! # if defined(MSWIN) // may be changed to "grep -n" in os_win32.c (char_u *)"findstr /n", ! # elif defined(UNIX) // Add an extra file name so that grep will always // insert a file name in the match line. (char_u *)"grep -n $* /dev/null", ! # elif defined(VMS) (char_u *)"SEARCH/NUMBERS ", ! # else (char_u *)"grep -n ", # endif (char_u *)0L} #else *************** *** 1431,1444 **** // ( and ) are used in text separating fnames (char_u *)"@,48-57,/,\\,.,-,_,+,,,#,$,%,{,},[,],:,@-@,!,~,=", #else ! # ifdef AMIGA (char_u *)"@,48-57,/,.,-,_,+,,,$,:", ! # else ! # ifdef VMS (char_u *)"@,48-57,/,.,-,_,+,,,#,$,%,<,>,[,],:,;,~", ! # else // UNIX et al. (char_u *)"@,48-57,/,.,-,_,+,,,#,$,%,~,=", - # endif # endif #endif (char_u *)0L} SCTX_INIT}, --- 1427,1438 ---- // ( and ) are used in text separating fnames (char_u *)"@,48-57,/,\\,.,-,_,+,,,#,$,%,{,},[,],:,@-@,!,~,=", #else ! # if defined(AMIGA) (char_u *)"@,48-57,/,.,-,_,+,,,$,:", ! # elif defined(VMS) (char_u *)"@,48-57,/,.,-,_,+,,,#,$,%,<,>,[,],:,;,~", ! # else // UNIX et al. (char_u *)"@,48-57,/,.,-,_,+,,,#,$,%,~,=", # endif #endif (char_u *)0L} SCTX_INIT}, *************** *** 1497,1514 **** {"keywordprg", "kp", P_STRING|P_EXPAND|P_VI_DEF|P_SECURE, (char_u *)&p_kp, PV_KP, { ! #ifdef MSWIN (char_u *)":help", ! #else ! # ifdef VMS (char_u *)"help", ! # else ! # ifdef USEMAN_S (char_u *)"man -s", ! # else (char_u *)"man", - # endif - # endif #endif (char_u *)0L} SCTX_INIT}, {"langmap", "lmap", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP|P_SECURE, --- 1491,1504 ---- {"keywordprg", "kp", P_STRING|P_EXPAND|P_VI_DEF|P_SECURE, (char_u *)&p_kp, PV_KP, { ! #if defined(MSWIN) (char_u *)":help", ! #elif defined(VMS) (char_u *)"help", ! #elif defined(USEMAN_S) (char_u *)"man -s", ! #else (char_u *)"man", #endif (char_u *)0L} SCTX_INIT}, {"langmap", "lmap", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP|P_SECURE, *************** *** 2767,2779 **** (char_u *)&p_viminfo, PV_NONE, #if defined(MSWIN) {(char_u *)"", (char_u *)"'100,<50,s10,h,rA:,rB:"} ! #else ! # ifdef AMIGA {(char_u *)"", (char_u *)"'100,<50,s10,h,rdf0:,rdf1:,rdf2:"} ! # else {(char_u *)"", (char_u *)"'100,<50,s10,h"} - # endif #endif #else (char_u *)NULL, PV_NONE, --- 2757,2767 ---- (char_u *)&p_viminfo, PV_NONE, #if defined(MSWIN) {(char_u *)"", (char_u *)"'100,<50,s10,h,rA:,rB:"} ! #elif defined(AMIGA) {(char_u *)"", (char_u *)"'100,<50,s10,h,rdf0:,rdf1:,rdf2:"} ! #else {(char_u *)"", (char_u *)"'100,<50,s10,h"} #endif #else (char_u *)NULL, PV_NONE, *** ../vim-8.2.4693/src/optionstr.c 2022-02-24 13:28:36.570222354 +0000 --- src/optionstr.c 2022-04-05 14:13:53.525176159 +0100 *************** *** 949,962 **** || check_opt_strings(p_wak, p_wak_values, FALSE) != OK) errmsg = e_invalid_argument; # ifdef FEAT_MENU ! # ifdef FEAT_GUI_MOTIF else if (gui.in_use) gui_motif_set_mnemonics(p_wak[0] == 'y' || p_wak[0] == 'm'); ! # else ! # ifdef FEAT_GUI_GTK else if (gui.in_use) gui_gtk_set_mnemonics(p_wak[0] == 'y' || p_wak[0] == 'm'); - # endif # endif # endif } --- 949,960 ---- || check_opt_strings(p_wak, p_wak_values, FALSE) != OK) errmsg = e_invalid_argument; # ifdef FEAT_MENU ! # if defined(FEAT_GUI_MOTIF) else if (gui.in_use) gui_motif_set_mnemonics(p_wak[0] == 'y' || p_wak[0] == 'm'); ! # elif defined(FEAT_GUI_GTK) else if (gui.in_use) gui_gtk_set_mnemonics(p_wak[0] == 'y' || p_wak[0] == 'm'); # endif # endif } *** ../vim-8.2.4693/src/version.c 2022-04-05 14:00:28.864929097 +0100 --- src/version.c 2022-04-05 14:15:23.309106752 +0100 *************** *** 711,738 **** #else "-xim", #endif ! #ifdef MSWIN # ifdef FEAT_XPM_W32 "+xpm_w32", # else "-xpm_w32", # endif ! #else ! # ifdef HAVE_XPM "+xpm", ! # else "-xpm", - # endif #endif #if defined(UNIX) || defined(VMS) ! # ifdef USE_XSMP_INTERACT "+xsmp_interact", ! # else ! # ifdef USE_XSMP "+xsmp", ! # else "-xsmp", - # endif # endif # ifdef FEAT_XCLIPBOARD "+xterm_clipboard", --- 711,734 ---- #else "-xim", #endif ! #if defined(MSWIN) # ifdef FEAT_XPM_W32 "+xpm_w32", # else "-xpm_w32", # endif ! #elif defined(HAVE_XPM) "+xpm", ! #else "-xpm", #endif #if defined(UNIX) || defined(VMS) ! # if defined(USE_XSMP_INTERACT) "+xsmp_interact", ! # elif defined(USE_XSMP) "+xsmp", ! # else "-xsmp", # endif # ifdef FEAT_XCLIPBOARD "+xterm_clipboard", *************** *** 10454,10506 **** } #endif ! #ifdef FEAT_HUGE msg_puts(_("\nHuge version ")); ! #else ! # ifdef FEAT_BIG msg_puts(_("\nBig version ")); ! # else ! # ifdef FEAT_NORMAL msg_puts(_("\nNormal version ")); ! # else ! # ifdef FEAT_SMALL msg_puts(_("\nSmall version ")); ! # else msg_puts(_("\nTiny version ")); - # endif - # endif - # endif #endif ! #ifndef FEAT_GUI msg_puts(_("without GUI.")); ! #else ! # ifdef FEAT_GUI_GTK ! # ifdef USE_GTK3 msg_puts(_("with GTK3 GUI.")); ! # else ! # ifdef FEAT_GUI_GNOME msg_puts(_("with GTK2-GNOME GUI.")); ! # else msg_puts(_("with GTK2 GUI.")); - # endif # endif ! # else ! # ifdef FEAT_GUI_MOTIF msg_puts(_("with X11-Motif GUI.")); ! # else ! # ifdef FEAT_GUI_HAIKU msg_puts(_("with Haiku GUI.")); ! # else ! # ifdef FEAT_GUI_PHOTON msg_puts(_("with Photon GUI.")); ! # else ! # if defined(MSWIN) msg_puts(_("with GUI.")); - # endif - # endif - # endif - # endif - # endif #endif version_msg(_(" Features included (+) or not (-):\n")); --- 10452,10486 ---- } #endif ! #if defined(FEAT_HUGE) msg_puts(_("\nHuge version ")); ! #elif defined(FEAT_BIG) msg_puts(_("\nBig version ")); ! #elif defined(FEAT_NORMAL) msg_puts(_("\nNormal version ")); ! #elif defined(FEAT_SMALL) msg_puts(_("\nSmall version ")); ! #else msg_puts(_("\nTiny version ")); #endif ! #if !defined(FEAT_GUI) msg_puts(_("without GUI.")); ! #elif defined(FEAT_GUI_GTK) ! # if defined(USE_GTK3) msg_puts(_("with GTK3 GUI.")); ! # elif defined(FEAT_GUI_GNOME) msg_puts(_("with GTK2-GNOME GUI.")); ! # else msg_puts(_("with GTK2 GUI.")); # endif ! #elif defined(FEAT_GUI_MOTIF) msg_puts(_("with X11-Motif GUI.")); ! #elif defined(FEAT_GUI_HAIKU) msg_puts(_("with Haiku GUI.")); ! #elif defined(FEAT_GUI_PHOTON) msg_puts(_("with Photon GUI.")); ! #elif defined(MSWIN) msg_puts(_("with GUI.")); #endif version_msg(_(" Features included (+) or not (-):\n")); *** ../vim-8.2.4693/src/version.c 2022-04-05 14:00:28.864929097 +0100 --- src/version.c 2022-04-05 14:15:23.309106752 +0100 *************** *** 752,753 **** --- 748,751 ---- { /* Add new patch number below this line */ + /**/ + 4694, /**/ -- Close your shells, or I'll kill -9 you Tomorrow I'll quota you Remember the disks'll always be full And then while I'm away I'll write ~ everyday And I'll send-pr all my buggings to you. [ CVS log "Beatles style" for FreeBSD ports/INDEX, Satoshi Asami ] /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///