mirror of
https://github.com/neovim/neovim.git
synced 2024-12-19 02:34:59 -07:00
Remove more #ifdef dead code
This commit is contained in:
parent
2d00ead2e5
commit
3da78364cc
@ -734,15 +734,12 @@ EXTERN int msg_silent INIT(= 0); /* don't print messages */
|
||||
EXTERN int emsg_silent INIT(= 0); /* don't print error messages */
|
||||
EXTERN int cmd_silent INIT(= FALSE); /* don't echo the command line */
|
||||
|
||||
#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG) \
|
||||
|| defined(FEAT_AUTOCMD)
|
||||
# define HAS_SWAP_EXISTS_ACTION
|
||||
#define HAS_SWAP_EXISTS_ACTION
|
||||
EXTERN int swap_exists_action INIT(= SEA_NONE);
|
||||
/* For dialog when swap file already
|
||||
* exists. */
|
||||
EXTERN int swap_exists_did_quit INIT(= FALSE);
|
||||
/* Selected "quit" at the dialog. */
|
||||
#endif
|
||||
|
||||
EXTERN char_u *IObuff; /* sprintf's are done in this buffer,
|
||||
size is IOSIZE */
|
||||
@ -906,12 +903,9 @@ EXTERN int lcs_tab2 INIT(= NUL);
|
||||
EXTERN int lcs_trail INIT(= NUL);
|
||||
EXTERN int lcs_conceal INIT(= '-');
|
||||
|
||||
#if defined(FEAT_WINDOWS) || defined(FEAT_WILDMENU) || defined(FEAT_STL_OPT) \
|
||||
|| defined(FEAT_FOLDING)
|
||||
/* Characters from 'fillchars' option */
|
||||
EXTERN int fill_stl INIT(= ' ');
|
||||
EXTERN int fill_stlnc INIT(= ' ');
|
||||
#endif
|
||||
EXTERN int fill_vert INIT(= ' ');
|
||||
EXTERN int fill_fold INIT(= '-');
|
||||
EXTERN int fill_diff INIT(= '-');
|
||||
@ -1002,13 +996,8 @@ EXTERN option_table_T printer_opts[OPT_PRINT_NUM_OPTIONS]
|
||||
# define PRT_UNIT_POINT 3
|
||||
# define PRT_UNIT_NAMES {"pc", "in", "mm", "pt"}
|
||||
|
||||
#if (defined(FEAT_PRINTER) && defined(FEAT_STL_OPT)) \
|
||||
|| defined(FEAT_GUI_TABLINE)
|
||||
/* Page number used for %N in 'pageheader' and 'guitablabel'. */
|
||||
EXTERN linenr_T printer_page_num;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
EXTERN int typebuf_was_filled INIT(= FALSE); /* received text from client
|
||||
@ -1073,10 +1062,6 @@ EXTERN char_u e_while[] INIT(= N_("E588: :endwhile without :while"));
|
||||
EXTERN char_u e_for[] INIT(= N_("E588: :endfor without :for"));
|
||||
EXTERN char_u e_exists[] INIT(= N_("E13: File exists (add ! to override)"));
|
||||
EXTERN char_u e_failed[] INIT(= N_("E472: Command failed"));
|
||||
#if defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK) || defined(MACOS) \
|
||||
|| defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_MSWIN)
|
||||
EXTERN char_u e_font[] INIT(= N_("E235: Unknown font: %s"));
|
||||
#endif
|
||||
EXTERN char_u e_internal[] INIT(= N_("E473: Internal error"));
|
||||
EXTERN char_u e_interr[] INIT(= N_("Interrupted"));
|
||||
EXTERN char_u e_invaddr[] INIT(= N_("E14: Invalid address"));
|
||||
@ -1089,17 +1074,6 @@ EXTERN char_u e_isadir2[] INIT(= N_("E17: \"%s\" is a directory"));
|
||||
#ifdef FEAT_LIBCALL
|
||||
EXTERN char_u e_libcall[] INIT(= N_("E364: Library call failed for \"%s()\""));
|
||||
#endif
|
||||
#if defined(DYNAMIC_PERL) \
|
||||
|| defined(DYNAMIC_PYTHON) || defined(DYNAMIC_PYTHON3) \
|
||||
|| defined(DYNAMIC_RUBY) \
|
||||
|| defined(DYNAMIC_TCL) \
|
||||
|| defined(DYNAMIC_ICONV) \
|
||||
|| defined(DYNAMIC_GETTEXT) \
|
||||
|| defined(DYNAMIC_MZSCHEME) \
|
||||
|| defined(DYNAMIC_LUA)
|
||||
EXTERN char_u e_loadlib[] INIT(= N_("E370: Could not load library %s"));
|
||||
EXTERN char_u e_loadfunc[] INIT(= N_("E448: Could not load library function %s"));
|
||||
#endif
|
||||
EXTERN char_u e_markinval[] INIT(= N_("E19: Mark has invalid line number"));
|
||||
EXTERN char_u e_marknotset[] INIT(= N_("E20: Mark not set"));
|
||||
EXTERN char_u e_modifiable[] INIT(= N_(
|
||||
@ -1186,10 +1160,7 @@ EXTERN char_u e_emptybuf[] INIT(= N_("E749: empty buffer"));
|
||||
EXTERN char_u e_invalpat[] INIT(= N_(
|
||||
"E682: Invalid search pattern or delimiter"));
|
||||
EXTERN char_u e_bufloaded[] INIT(= N_("E139: File is loaded in another buffer"));
|
||||
#if defined(FEAT_SYN_HL) || \
|
||||
(defined(FEAT_INS_EXPAND) && defined(FEAT_COMPL_FUNC))
|
||||
EXTERN char_u e_notset[] INIT(= N_("E764: Option '%s' is not set"));
|
||||
#endif
|
||||
EXTERN char_u e_invalidreg[] INIT(= N_("E850: Invalid register name"));
|
||||
|
||||
|
||||
|
1319
src/main.c
1319
src/main.c
File diff suppressed because it is too large
Load Diff
@ -102,13 +102,6 @@ static RETSIGTYPE catch_sigint __ARGS(SIGPROTOARG);
|
||||
#if defined(SIGPWR)
|
||||
static RETSIGTYPE catch_sigpwr __ARGS(SIGPROTOARG);
|
||||
#endif
|
||||
#if defined(SIGALRM) && defined(FEAT_X11) \
|
||||
&& defined(FEAT_TITLE) && !defined(FEAT_GUI_GTK)
|
||||
# define SET_SIG_ALARM
|
||||
static RETSIGTYPE sig_alarm __ARGS(SIGPROTOARG);
|
||||
/* volatile because it is used in signal handler sig_alarm(). */
|
||||
static volatile int sig_alarm_called;
|
||||
#endif
|
||||
static RETSIGTYPE deathtrap __ARGS(SIGPROTOARG);
|
||||
|
||||
static void catch_int_signal __ARGS((void));
|
||||
@ -179,7 +172,7 @@ static struct signalinfo {
|
||||
#ifdef SIGBUS
|
||||
{SIGBUS, "BUS", TRUE},
|
||||
#endif
|
||||
#if defined(SIGSEGV) && !defined(FEAT_MZSCHEME)
|
||||
#if defined(SIGSEGV)
|
||||
/* MzScheme uses SEGV in its garbage collector */
|
||||
{SIGSEGV, "SEGV", TRUE},
|
||||
#endif
|
||||
@ -192,10 +185,10 @@ static struct signalinfo {
|
||||
#ifdef SIGTERM
|
||||
{SIGTERM, "TERM", TRUE},
|
||||
#endif
|
||||
#if defined(SIGVTALRM) && !defined(FEAT_RUBY)
|
||||
#if defined(SIGVTALRM)
|
||||
{SIGVTALRM, "VTALRM", TRUE},
|
||||
#endif
|
||||
#if defined(SIGPROF) && !defined(FEAT_MZSCHEME) && !defined(WE_ARE_PROFILING)
|
||||
#if defined(SIGPROF) && !defined(WE_ARE_PROFILING)
|
||||
/* MzScheme uses SIGPROF for its own needs; On Linux with profiling
|
||||
* this makes Vim exit. WE_ARE_PROFILING is defined in Makefile. */
|
||||
{SIGPROF, "PROF", TRUE},
|
||||
@ -682,23 +675,7 @@ catch_sigpwr SIGDEFARG(sigarg) {
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef SET_SIG_ALARM
|
||||
/*
|
||||
* signal function for alarm().
|
||||
*/
|
||||
static RETSIGTYPE
|
||||
sig_alarm SIGDEFARG(sigarg) {
|
||||
/* doesn't do anything, just to break a system call */
|
||||
sig_alarm_called = TRUE;
|
||||
SIGRETURN;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if (defined(HAVE_SETJMP_H) \
|
||||
&& ((defined(FEAT_X11) && defined(FEAT_XCLIPBOARD)) \
|
||||
|| defined(FEAT_LIBCALL))) \
|
||||
|| defined(PROTO)
|
||||
#if (defined(HAVE_SETJMP_H) && defined(FEAT_LIBCALL)) || defined(PROTO)
|
||||
/*
|
||||
* A simplistic version of setjmp() that only allows one level of using.
|
||||
* Don't call twice before calling mch_endjmp()!.
|
||||
@ -1192,11 +1169,6 @@ char_u *icon;
|
||||
|
||||
if (*T_TS != NUL) /* it's OK if t_fs is empty */
|
||||
term_settitle(title);
|
||||
#if defined(FEAT_GUI_GTK) \
|
||||
|| defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_MAC)
|
||||
else
|
||||
gui_mch_settitle(title, icon);
|
||||
#endif
|
||||
did_set_title = TRUE;
|
||||
}
|
||||
|
||||
@ -2152,42 +2124,6 @@ int on;
|
||||
ison = on;
|
||||
}
|
||||
|
||||
|
||||
|
||||
# ifdef FEAT_MOUSE_JSB
|
||||
else {
|
||||
if (on) {
|
||||
/* D - Enable Mouse up/down messages
|
||||
* L - Enable Left Button Reporting
|
||||
* M - Enable Middle Button Reporting
|
||||
* R - Enable Right Button Reporting
|
||||
* K - Enable SHIFT and CTRL key Reporting
|
||||
* + - Enable Advanced messaging of mouse moves and up/down messages
|
||||
* Q - Quiet No Ack
|
||||
* # - Numeric value of mouse pointer required
|
||||
* 0 = Multiview 2000 cursor, used as standard
|
||||
* 1 = Windows Arrow
|
||||
* 2 = Windows I Beam
|
||||
* 3 = Windows Hour Glass
|
||||
* 4 = Windows Cross Hair
|
||||
* 5 = Windows UP Arrow
|
||||
*/
|
||||
# ifdef JSBTERM_MOUSE_NONADVANCED
|
||||
/* Disables full feedback of pointer movements */
|
||||
out_str_nf((char_u *)IF_EB("\033[0~ZwLMRK1Q\033\\",
|
||||
ESC_STR "[0~ZwLMRK1Q" ESC_STR "\\"));
|
||||
# else
|
||||
out_str_nf((char_u *)IF_EB("\033[0~ZwLMRK+1Q\033\\",
|
||||
ESC_STR "[0~ZwLMRK+1Q" ESC_STR "\\"));
|
||||
# endif
|
||||
ison = TRUE;
|
||||
} else {
|
||||
out_str_nf((char_u *)IF_EB("\033[0~ZwQ\033\\",
|
||||
ESC_STR "[0~ZwQ" ESC_STR "\\"));
|
||||
ison = FALSE;
|
||||
}
|
||||
}
|
||||
# endif
|
||||
}
|
||||
|
||||
/*
|
||||
@ -2210,17 +2146,6 @@ void check_mouse_termcode() {
|
||||
del_mouse_termcode(KS_MOUSE);
|
||||
|
||||
|
||||
|
||||
# ifdef FEAT_MOUSE_JSB
|
||||
/* conflicts with xterm mouse: "\033[" and "\033[M" ??? */
|
||||
if (!use_xterm_mouse()
|
||||
)
|
||||
set_mouse_termcode(KS_JSBTERM_MOUSE,
|
||||
(char_u *)IF_EB("\033[0~zw", ESC_STR "[0~zw"));
|
||||
else
|
||||
del_mouse_termcode(KS_JSBTERM_MOUSE);
|
||||
# endif
|
||||
|
||||
/* There is no conflict, but one may type "ESC }" from Insert mode. Don't
|
||||
* define it in the GUI or when using an xterm. */
|
||||
if (!use_xterm_mouse()
|
||||
|
151
src/vim.h
151
src/vim.h
@ -18,13 +18,6 @@
|
||||
#define RUNTIME_DIRNAME "runtime"
|
||||
/* end */
|
||||
|
||||
/* use fastcall for Borland, when compiling for Win32 (not for DOS16) */
|
||||
|
||||
#if defined(MSDOS) || defined(WIN16) || defined(WIN32) || defined(_WIN64) \
|
||||
|| defined(__EMX__)
|
||||
# include "vimio.h"
|
||||
#endif
|
||||
|
||||
/* ============ the header file puzzle (ca. 50-100 pieces) ========= */
|
||||
|
||||
#ifdef HAVE_CONFIG_H /* GNU autoconf (or something else) was here */
|
||||
@ -64,65 +57,12 @@ Error: configure did not run properly.Check auto/config.log.
|
||||
# define ROOT_UID 0
|
||||
|
||||
|
||||
/*
|
||||
* MACOS_CLASSIC compiling for MacOS prior to MacOS X
|
||||
* MACOS_X_UNIX compiling for MacOS X (using os_unix.c)
|
||||
* MACOS_X compiling for MacOS X (using os_unix.c)
|
||||
* MACOS compiling for either one
|
||||
*/
|
||||
/* Unless made through the Makefile enforce GUI on Mac */
|
||||
|
||||
#if defined(FEAT_GUI_MOTIF) \
|
||||
|| defined(FEAT_GUI_GTK) \
|
||||
|| defined(FEAT_GUI_ATHENA) \
|
||||
|| defined(FEAT_GUI_MAC) \
|
||||
|| defined(FEAT_GUI_W32) \
|
||||
|| defined(FEAT_GUI_W16) \
|
||||
|| defined(FEAT_GUI_PHOTON)
|
||||
# define FEAT_GUI_ENABLED /* also defined with NO_X11_INCLUDES */
|
||||
# if !defined(FEAT_GUI) && !defined(NO_X11_INCLUDES)
|
||||
# define FEAT_GUI
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Visual Studio 2005 has 'deprecated' many of the standard CRT functions */
|
||||
|
||||
/* Practically everything is common to both Win32 and Win64 */
|
||||
|
||||
/*
|
||||
* SIZEOF_INT is used in feature.h, and the system-specific included files
|
||||
* need items from feature.h. Therefore define SIZEOF_INT here.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
/* +x11 is only enabled when it's both available and wanted. */
|
||||
|
||||
#ifdef NO_X11_INCLUDES
|
||||
/* In os_mac_conv.c and os_macosx.m NO_X11_INCLUDES is defined to avoid
|
||||
* X11 headers. Disable all X11 related things to avoid conflicts. */
|
||||
#endif
|
||||
|
||||
/* The Mac conversion stuff doesn't work under X11. */
|
||||
|
||||
/* Can't use "PACKAGE" here, conflicts with a Perl include file. */
|
||||
#ifndef VIMPACKAGE
|
||||
# define VIMPACKAGE "vim"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Find out if function definitions should include argument types
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#if (defined(UNIX) || defined(__EMX__) || defined(VMS)) \
|
||||
&& (!defined(MACOS_X) || defined(HAVE_CONFIG_H))
|
||||
# include "os_unix.h" /* bring lots of system header files */
|
||||
#endif
|
||||
#include "os_unix.h" /* bring lots of system header files */
|
||||
|
||||
#ifndef __ARGS
|
||||
# if defined(__STDC__) || defined(__GNUC__) || defined(WIN3264)
|
||||
@ -132,11 +72,6 @@ Error: configure did not run properly.Check auto/config.log.
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* __ARGS and __PARMS are the same thing. */
|
||||
#ifndef __PARMS
|
||||
# define __PARMS(x) __ARGS(x)
|
||||
#endif
|
||||
|
||||
/* Mark unused function arguments with UNUSED, so that gcc -Wunused-parameter
|
||||
* can be used to check for mistakes. */
|
||||
#ifdef HAVE_ATTRIBUTE_UNUSED
|
||||
@ -145,26 +80,6 @@ Error: configure did not run properly.Check auto/config.log.
|
||||
# define UNUSED
|
||||
#endif
|
||||
|
||||
/* if we're compiling in C++ (currently only KVim), the system
|
||||
* headers must have the correct prototypes or nothing will build.
|
||||
* conversely, our prototypes might clash due to throw() specifiers and
|
||||
* cause compilation failures even though the headers are correct. For
|
||||
* a concrete example, gcc-3.2 enforces exception specifications, and
|
||||
* glibc-2.2.5 has them in their system headers.
|
||||
*/
|
||||
#if !defined(__cplusplus) && defined(UNIX) \
|
||||
&& !defined(MACOS_X) /* MACOS_X doesn't yet support osdef.h */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# ifdef HAVE_LOCALE_H
|
||||
# include <locale.h>
|
||||
# endif
|
||||
@ -245,46 +160,12 @@ typedef unsigned long u8char_T; /* long should be 32 bits or more */
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#ifndef UNIX /* For Unix this is included in os_unix.h */
|
||||
# include <stdio.h>
|
||||
# include <ctype.h>
|
||||
#endif
|
||||
|
||||
#include "ascii.h"
|
||||
#include "keymap.h"
|
||||
#include "term.h"
|
||||
#include "macros.h"
|
||||
|
||||
#ifdef LATTICE
|
||||
# include <sys/types.h>
|
||||
# include <sys/stat.h>
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_ERRNO_H) || defined(DJGPP) || defined(WIN16) \
|
||||
|| defined(WIN32) || defined(_WIN64) || defined(__EMX__)
|
||||
# include <errno.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Allow other (non-unix) systems to configure themselves now
|
||||
* These are also in os_unix.h, because osdef.sh needs them there.
|
||||
*/
|
||||
#ifndef UNIX
|
||||
/* Note: Some systems need both string.h and strings.h (Savage). If the
|
||||
* system can't handle this, define NO_STRINGS_WITH_STRING_H. */
|
||||
# ifdef HAVE_STRING_H
|
||||
# include <string.h>
|
||||
# endif
|
||||
# if defined(HAVE_STRINGS_H) && !defined(NO_STRINGS_WITH_STRING_H)
|
||||
# include <strings.h>
|
||||
# endif
|
||||
# ifdef HAVE_STAT_H
|
||||
# include <stat.h>
|
||||
# endif
|
||||
# ifdef HAVE_STDLIB_H
|
||||
# include <stdlib.h>
|
||||
# endif
|
||||
#endif /* NON-UNIX */
|
||||
#include <errno.h>
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
@ -306,36 +187,8 @@ typedef unsigned long u8char_T; /* long should be 32 bits or more */
|
||||
# include <sys/select.h>
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_SELECT
|
||||
# ifdef HAVE_SYS_POLL_H
|
||||
# include <sys/poll.h>
|
||||
# define HAVE_POLL
|
||||
# else
|
||||
# ifdef HAVE_POLL_H
|
||||
# include <poll.h>
|
||||
# define HAVE_POLL
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* ================ end of the header file puzzle =============== */
|
||||
|
||||
/*
|
||||
* For dynamically loaded imm library. Currently, only for Win32.
|
||||
*/
|
||||
#ifdef DYNAMIC_IME
|
||||
# define FEAT_MBYTE_IME
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Check input method control.
|
||||
*/
|
||||
#if defined(FEAT_XIM) \
|
||||
|| (defined(FEAT_GUI) && (defined(FEAT_MBYTE_IME) || defined(GLOBAL_IME))) \
|
||||
|| (defined(FEAT_GUI_MAC) && defined(FEAT_MBYTE))
|
||||
# define USE_IM_CONTROL
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_WORKING_LIBINTL
|
||||
# include <libintl.h>
|
||||
# define _(x) gettext((char *)(x))
|
||||
|
Loading…
Reference in New Issue
Block a user