# HG changeset patch # User Bram Moolenaar # Date 1590856204 -7200 # Node ID 4411c2b96af909229d4d71372778680fd396bbb0 # Parent a76cdc4bf606c629cbc198a5e81bdf77a3eb2dc7 patch 8.2.0849: BeOS code is not maintained and probably unused Commit: https://github.com/vim/vim/commit/041c7107f23d3b49ab62c1d7e36af90421db8b63 Author: Bram Moolenaar Date: Sat May 30 18:14:57 2020 +0200 patch 8.2.0849: BeOS code is not maintained and probably unused Problem: BeOS code is not maintained and probably unused. Solution: Remove the BeOS code. (Emir Sari, closes https://github.com/vim/vim/issues/5817) diff --git a/Filelist b/Filelist --- a/Filelist +++ b/Filelist @@ -673,10 +673,6 @@ SRC_EXTRA = \ src/Make_mint.mak \ src/infplist.xml \ src/link.390 \ - src/os_beos.c \ - src/os_beos.h \ - src/os_beos.rsrc \ - src/proto/os_beos.pro \ src/os_mint.h \ src/os_vms_fix.com \ src/toolbar.phi \ diff --git a/src/Makefile b/src/Makefile --- a/src/Makefile +++ b/src/Makefile @@ -2026,7 +2026,7 @@ PRO_AUTO = \ RSRC_DIR = os_mac_rsrc PRO_MANUAL = os_amiga.pro os_win32.pro \ - os_mswin.pro winclip.pro os_beos.pro os_vms.pro $(PERL_PRO) + os_mswin.pro winclip.pro os_vms.pro $(PERL_PRO) # Default target is making the executable and tools all: $(VIMTARGET) $(TOOLS) languages $(GUI_BUNDLE) @@ -2193,10 +2193,6 @@ winclip.pro: winclip.c $(CPROTO) -DWIN32 -UHAVE_CONFIG_H $< > proto/$@ echo "/* vim: set ft=c : */" >> proto/$@ -os_beos.pro: os_beos.c - $(CPROTO) -D__BEOS__ -UHAVE_CONFIG_H $< > proto/$@ - echo "/* vim: set ft=c : */" >> proto/$@ - os_vms.pro: os_vms.c # must use os_vms_conf.h for auto/config.h mv auto/config.h auto/config.h.save @@ -3394,9 +3390,6 @@ objects/option.o: option.c optiondefs.h objects/optionstr.o: optionstr.c $(CCC_NF) $(LUA_CFLAGS) $(PERL_CFLAGS) $(PYTHON_CFLAGS) $(PYTHON3_CFLAGS) $(RUBY_CFLAGS) $(TCL_CFLAGS) $(ALL_CFLAGS) -o $@ optionstr.c -objects/os_beos.o: os_beos.c - $(CCC) -o $@ os_beos.c - objects/os_qnx.o: os_qnx.c $(CCC) -o $@ os_qnx.c diff --git a/src/auto/configure b/src/auto/configure --- a/src/auto/configure +++ b/src/auto/configure @@ -4533,16 +4533,6 @@ fi OS_EXTRA_SRC=""; OS_EXTRA_OBJ="" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BeOS" >&5 -$as_echo_n "checking for BeOS... " >&6; } -case `uname` in - BeOS) OS_EXTRA_SRC=os_beos.c; OS_EXTRA_OBJ=objects/os_beos.o - BEOS=yes; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; };; - *) BEOS=no; { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; };; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Haiku" >&5 $as_echo_n "checking for Haiku... " >&6; } case `uname` in diff --git a/src/configure.ac b/src/configure.ac --- a/src/configure.ac +++ b/src/configure.ac @@ -146,14 +146,6 @@ fi OS_EXTRA_SRC=""; OS_EXTRA_OBJ="" -dnl Check for BeOS, which needs an extra source file -AC_MSG_CHECKING(for BeOS) -case `uname` in - BeOS) OS_EXTRA_SRC=os_beos.c; OS_EXTRA_OBJ=objects/os_beos.o - BEOS=yes; AC_MSG_RESULT(yes);; - *) BEOS=no; AC_MSG_RESULT(no);; -esac - AC_MSG_CHECKING(for Haiku) case `uname` in Haiku) HAIKU=yes; AC_MSG_RESULT(yes);; diff --git a/src/evalfunc.c b/src/evalfunc.c --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -3387,13 +3387,6 @@ f_has(typval_T *argvars, typval_T *rettv 0 #endif }, - {"beos", -#ifdef __BEOS__ - 1 -#else - 0 -#endif - }, {"haiku", #ifdef __HAIKU__ 1 diff --git a/src/normal.c b/src/normal.c --- a/src/normal.c +++ b/src/normal.c @@ -3385,14 +3385,6 @@ nv_clear(cmdarg_T *cap) { if (!checkclearop(cap->oap)) { -#if defined(__BEOS__) && !USE_THREAD_FOR_INPUT_WITH_TIMEOUT - /* - * Right now, the BeBox doesn't seem to have an easy way to detect - * window resizing, so we cheat and make the user detect it - * manually with CTRL-L instead - */ - ui_get_shellsize(); -#endif #ifdef FEAT_SYN_HL // Clear all syntax states to force resyncing. syn_stack_free_all(curwin->w_s); diff --git a/src/os_beos.c b/src/os_beos.c deleted file mode 100644 --- a/src/os_beos.c +++ /dev/null @@ -1,200 +0,0 @@ -/* vi:set ts=8 sts=4 sw=4 noet: - * - * VIM - Vi IMproved by Bram Moolenaar - * BeBox port Copyright 1997 by Olaf Seibert. - * - * Do ":help uganda" in Vim to read copying and usage conditions. - * Do ":help credits" in Vim to see a list of people who contributed. - * See README.txt for an overview of the Vim source code. - */ -/* - * os_beos.c Additional stuff for BeOS (rest is in os_unix.c) - */ - -#include -#include -#ifndef PROTO -# include -#endif - -#include "vim.h" - -#if USE_THREAD_FOR_INPUT_WITH_TIMEOUT - -#ifdef PROTO // making prototypes on Unix -#define sem_id int -#define thread_id int -#endif - -char_u charbuf; -signed char charcount; -sem_id character_present; -sem_id character_wanted; -thread_id read_thread_id; - -#define TRY_ABORT 0 // This code does not work so turn it off. - -#if TRY_ABORT - static void -mostly_ignore(int sig) -{ -} -#endif - - static long -read_thread(void *dummy) -{ - signal(SIGINT, SIG_IGN); - signal(SIGQUIT, SIG_IGN); -#if TRY_ABORT - signal(SIGUSR1, mostly_ignore); -#endif - - for (;;) { - if (acquire_sem(character_wanted) != B_NO_ERROR) - break; - charcount = read(read_cmd_fd, &charbuf, 1); - release_sem(character_present); - } - - return 0; -} - - void -beos_cleanup_read_thread(void) -{ - if (character_present > 0) - delete_sem(character_present); - character_present = 0; - if (read_thread_id > 0) - kill_thread(read_thread_id); - read_thread_id = 0; -} - -#endif - -/* - * select() emulation. Hopefully, in DR9 there will be something - * useful supplied by the system. ... Alas, not. Not in AAPR, nor - * in PR or even PR2... R3 then maybe? I don't think so! - */ - - int -beos_select(int nbits, - struct fd_set *rbits, - struct fd_set *wbits, - struct fd_set *ebits, - struct timeval *timeout) -{ - bigtime_t tmo; - - if (nbits == 0) { - // select is purely being used for delay - snooze(timeout->tv_sec * 1e6 + timeout->tv_usec); - return 0; - } -#if 0 - /* - * This does not seem to work either. Reads here are not supposed to - * block indefinitely, yet they do. This is most annoying. - */ - if (FD_ISSET(0, rbits)) { - char cbuf[1]; - int count; - struct termios told; - struct termios tnew; - tcgetattr(0, &told); - tnew = told; - tnew.c_lflag &= ~ICANON; - tnew.c_cc[VMIN] = 0; - tnew.c_cc[VTIME] = timeout->tv_sec * 10 + timeout->tv_usec / 100000; - tcsetattr(0, TCSANOW, &tnew); - - count = read(0, &cbuf, sizeof(cbuf)); - tcsetattr(0, TCSANOW, &told); - if (count > 0) { - add_to_input_buf(&cbuf[0], count); - return 1; - } - return 0; - } -#endif -#if USE_THREAD_FOR_INPUT_WITH_TIMEOUT - /* - * Check if the operation is really on stdin... - */ - if (FD_ISSET(read_cmd_fd, rbits)) - { - int acquired; - - /* - * Is this the first time through? - * Then start up the thread and initialise the semaphores. - */ - if (character_present == 0) { - character_present = create_sem(0, "vim character_present"); - character_wanted = create_sem(1, "vim character_wanted"); - read_thread_id = spawn_thread(read_thread, "vim async read", - B_NORMAL_PRIORITY, NULL); - atexit(beos_cleanup_read_thread); - resume_thread(read_thread_id); - } - - // timeout == NULL means "indefinitely" - if (timeout) { - tmo = timeout->tv_sec * 1e6 + timeout->tv_usec; - // 0 means "don't wait, which is impossible to do exactly. - if (tmo == 0) - tmo = 1.0; - } -#if TRY_ABORT - release_sem(character_wanted); -#endif - if (timeout) - acquired = acquire_sem_etc(character_present, 1, B_TIMEOUT, tmo); - else - acquired = acquire_sem(character_present); - if (acquired == B_NO_ERROR) { - if (charcount > 0) { - add_to_input_buf(&charbuf, 1); -#if !TRY_ABORT - release_sem(character_wanted); -#endif - - return 1; - } else { -#if !TRY_ABORT - release_sem(character_wanted); -#endif - - return 0; - } - } -#if TRY_ABORT - else { - /* - * Timeout occurred. Break the read() call by sending - * a signal. Problem: it may be just read()ing it now. - * Therefore we still have to finish the handshake with - * the thread and maybe remember the character. - */ - kill(read_thread_id, SIGUSR1); - /* - * If some other error occurred, don't hang now. - * (We will most likely hang later anyway...) - */ - if (acquired == B_TIMED_OUT) - acquire_sem(character_present); - if (charcount > 0) { - add_to_input_buf(&charbuf, 1); - return 1; - } - return 0; - } -#endif - } -#endif - - return 0; -} - diff --git a/src/os_beos.h b/src/os_beos.h deleted file mode 100644 --- a/src/os_beos.h +++ /dev/null @@ -1,27 +0,0 @@ -/* vi:set ts=8 sts=4 sw=4 noet: - * - * VIM - Vi IMproved by Bram Moolenaar - * BeBox port by Olaf Seibert - * - * Do ":help uganda" in Vim to read copying and usage conditions. - * Do ":help credits" in Vim to see a list of people who contributed. - */ - -/* - * os_beos.h - */ - -#undef USE_SYSTEM -#define USE_THREAD_FOR_INPUT_WITH_TIMEOUT 1 -#define USE_TERM_CONSOLE - -#define HAVE_DROP_FILE - -#undef BEOS_DR8 -#define BEOS_PR_OR_BETTER - -// select emulation - -#ifndef PROTO -# include // for typedefs and #defines only -#endif diff --git a/src/os_beos.rsrc b/src/os_beos.rsrc deleted file mode 100644 index f6443cd60ba62be76c5806c794249212eb0fed65..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 GIT binary patch literal 0 Hc$@ @@ -150,7 +145,7 @@ typedef int waitstatus; #endif static int WaitForChar(long msec, int *interrupted, int ignore_input); static int WaitForCharOrMouse(long msec, int *interrupted, int ignore_input); -#if defined(__BEOS__) || defined(VMS) +#ifdef VMS int RealWaitForChar(int, long, int *, int *interrupted); #else static int RealWaitForChar(int, long, int *, int *interrupted); @@ -1245,8 +1240,7 @@ mch_suspend(void) if (ignore_sigtstp) return; - // BeOS does have SIGTSTP, but it doesn't work. -#if defined(SIGTSTP) && !defined(__BEOS__) +#if defined(SIGTSTP) in_mch_suspend = TRUE; out_flush(); // needed to make cursor visible on some systems @@ -3486,10 +3480,13 @@ mch_settmode(tmode_T tmode) tnew = told; if (tmode == TMODE_RAW) { - /* - * ~ICRNL enables typing ^V^M - */ + // ~ICRNL enables typing ^V^M tnew.c_iflag &= ~ICRNL; +# ifdef IXON_NOT_USED + // Do not make CTRL-S stop output, for most users it is unexpected and + // is hardly ever useful. + tnew.c_iflag |= IXON; +# endif tnew.c_lflag &= ~(ICANON | ECHO | ISIG | ECHOE # if defined(IEXTEN) && !defined(__MINT__) | IEXTEN // IEXTEN enables typing ^V on SOLARIS @@ -4631,11 +4628,6 @@ mch_call_shell_fork( if (!pipe_error) // pty or pipe opened or not used { SIGSET_DECL(curset) - -# if defined(__BEOS__) && USE_THREAD_FOR_INPUT_WITH_TIMEOUT - beos_cleanup_read_thread(); -# endif - BLOCK_SIGNALS(&curset); pid = fork(); // maybe we should use vfork() if (pid == -1) @@ -6075,11 +6067,7 @@ WaitForCharOrMouse(long msec, int *inter * "interrupted" (if not NULL) is set to TRUE when no character is available * but something else needs to be done. */ -#if defined(__BEOS__) - int -#else static int -#endif RealWaitForChar(int fd, long msec, int *check_for_gpm UNUSED, int *interrupted) { int ret; diff --git a/src/proto.h b/src/proto.h --- a/src/proto.h +++ b/src/proto.h @@ -49,9 +49,6 @@ extern int _stricoll(char *a, char *b); # ifdef VMS # include "os_vms.pro" # endif -# ifdef __BEOS__ -# include "os_beos.pro" -# endif # ifdef __QNX__ # include "os_qnx.pro" # endif diff --git a/src/proto/os_beos.pro b/src/proto/os_beos.pro deleted file mode 100644 --- a/src/proto/os_beos.pro +++ /dev/null @@ -1,4 +0,0 @@ -/* os_beos.c */ -void beos_cleanup_read_thread(void); -int beos_select(int nbits, struct fd_set *rbits, struct fd_set *wbits, struct fd_set *ebits, struct timeval *timeout); -/* vim: set ft=c : */ diff --git a/src/pty.c b/src/pty.c --- a/src/pty.c +++ b/src/pty.c @@ -386,7 +386,7 @@ mch_openpty(char **ttyn) static char PtyProto[] = "/dev/ptym/ptyXY"; static char TtyProto[] = "/dev/pty/ttyXY"; # else -# if defined (__BEOS__) || defined(__HAIKU__) +# ifdef(__HAIKU__) static char PtyProto[] = "/dev/pt/XY"; static char TtyProto[] = "/dev/tt/XY"; # else diff --git a/src/screen.c b/src/screen.c --- a/src/screen.c +++ b/src/screen.c @@ -3868,19 +3868,6 @@ screen_del_lines( type = USE_REDRAW; else if (can_clear(T_CD) && result_empty) type = USE_T_CD; -#if defined(__BEOS__) && defined(BEOS_DR8) - /* - * USE_NL does not seem to work in Terminal of DR8 so we set T_DB="" in - * its internal termcap... this works okay for tests which test *T_DB != - * NUL. It has the disadvantage that the user cannot use any :set t_* - * command to get T_DB (back) to empty_option, only :set term=... will do - * the trick... - * Anyway, this hack will hopefully go away with the next OS release. - * (Olaf Seibert) - */ - else if (row == 0 && T_DB == empty_option - && (line_count == 1 || *T_CDL == NUL)) -#else else if (row == 0 && ( #ifndef AMIGA // On the Amiga, somehow '\n' on the last line doesn't always scroll @@ -3888,7 +3875,6 @@ screen_del_lines( line_count == 1 || #endif *T_CDL == NUL)) -#endif type = USE_NL; else if (*T_CDL != NUL && line_count > 1 && can_delete) type = USE_T_CDL; diff --git a/src/term.c b/src/term.c --- a/src/term.c +++ b/src/term.c @@ -362,11 +362,10 @@ static struct builtin_term builtin_termc {TERMCAP2KEY('*', '7'), "\233\065\065~"}, // shifted end key # endif -# if defined(__BEOS__) || defined(ALL_BUILTIN_TCAPS) +# ifdef ALL_BUILTIN_TCAPS /* - * almost standard ANSI terminal, default for bebox + * almost standard ANSI terminal */ - {(int)KS_NAME, "beos-ansi"}, {(int)KS_CE, "\033[K"}, {(int)KS_CD, "\033[J"}, {(int)KS_AL, "\033[L"}, @@ -381,13 +380,6 @@ static struct builtin_term builtin_termc # else {(int)KS_CDL, "\033[%dM"}, # endif -#ifdef BEOS_PR_OR_BETTER -# ifdef TERMINFO - {(int)KS_CS, "\033[%i%p1%d;%p2%dr"}, -# else - {(int)KS_CS, "\033[%i%d;%dr"}, // scroll region -# endif -#endif {(int)KS_CL, "\033[H\033[2J"}, #ifdef notyet {(int)KS_VI, "[VI]"}, // cursor invisible, VT320: CSI ? 25 l @@ -425,9 +417,6 @@ static struct builtin_term builtin_termc # else {(int)KS_CRI, "\033[%dC"}, # endif -# if defined(BEOS_DR8) - {(int)KS_DB, ""}, // hack! see screen.c -# endif {K_UP, "\033[A"}, {K_DOWN, "\033[B"}, @@ -1415,11 +1404,6 @@ termgui_mch_get_rgb(guicolor_T color) # define DEFAULT_TERM (char_u *)"vt320" #endif -#ifdef __BEOS__ -# undef DEFAULT_TERM -# define DEFAULT_TERM (char_u *)"beos-ansi" -#endif - #ifdef __HAIKU__ # undef DEFAULT_TERM # define DEFAULT_TERM (char_u *)"xterm" @@ -2429,17 +2413,6 @@ termcapinit(char_u *name) name = NULL; // empty name is equal to no name term = name; -#ifdef __BEOS__ - /* - * TERM environment variable is normally set to 'ansi' on the Bebox; - * Since the BeBox doesn't quite support full ANSI yet, we use our - * own custom 'ansi-beos' termcap instead, unless the -T option has - * been given on the command line. - */ - if (term == NULL - && strcmp((char *)mch_getenv((char_u *)"TERM"), "ansi") == 0) - term = DEFAULT_TERM; -#endif #ifndef MSWIN if (term == NULL) term = mch_getenv((char_u *)"TERM"); diff --git a/src/testdir/test_functions.vim b/src/testdir/test_functions.vim --- a/src/testdir/test_functions.vim +++ b/src/testdir/test_functions.vim @@ -1766,11 +1766,10 @@ endfunc func Test_platform_name() " The system matches at most only one name. - let names = ['amiga', 'beos', 'bsd', 'hpux', 'linux', 'mac', 'qnx', 'sun', 'vms', 'win32', 'win32unix'] + let names = ['amiga', 'bsd', 'hpux', 'linux', 'mac', 'qnx', 'sun', 'vms', 'win32', 'win32unix'] call assert_inrange(0, 1, len(filter(copy(names), 'has(v:val)'))) " Is Unix? - call assert_equal(has('beos'), has('beos') && has('unix')) call assert_equal(has('bsd'), has('bsd') && has('unix')) call assert_equal(has('hpux'), has('hpux') && has('unix')) call assert_equal(has('linux'), has('linux') && has('unix')) @@ -1782,7 +1781,6 @@ func Test_platform_name() if has('unix') && executable('uname') let uname = system('uname') - call assert_equal(uname =~? 'BeOS', has('beos')) " GNU userland on BSD kernels (e.g., GNU/kFreeBSD) don't have BSD defined call assert_equal(uname =~? '\%(GNU/k\w\+\)\@ 0) diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -747,6 +747,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 849, +/**/ 848, /**/ 847, diff --git a/src/vim.h b/src/vim.h --- a/src/vim.h +++ b/src/vim.h @@ -220,10 +220,6 @@ # include #endif -#ifdef __BEOS__ -# include "os_beos.h" -#endif - #ifdef __HAIKU__ # include "os_haiku.h" # define __ARGS(x) x