# define STRICT
#endif
-#define INC_OLE2 // WIN32, get ole2 from windows.h
+#define INC_OLE2 // MS-Windows, get ole2 from windows.h
/* Visual Studio 2005 has 'deprecated' many of the standard CRT functions */
#if defined(_MSC_VER) && _MSC_VER >= 1400
!endif
!if ("$(GUI)"=="yes")
-DEFINES = $(DEFINES) -DFEAT_GUI_W32 -DFEAT_CLIPBOARD
+DEFINES = $(DEFINES) -DFEAT_GUI -DFEAT_CLIPBOARD
!if ("$(DEBUG)"=="yes")
TARGET = gvimd.exe
!else
# See feature.h for a list of options.
# Any other defines can be included here.
-DEF_GUI=-DFEAT_GUI_W32 -DFEAT_CLIPBOARD
+DEF_GUI=-DFEAT_GUI -DFEAT_CLIPBOARD
DEFINES=-DWIN32 -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER) \
-DHAVE_PATHDEF -DFEAT_$(FEATURES) -DHAVE_STDINT_H
ifeq ($(ARCH),x86-64)
# ADD LINK32 oldnames.lib kernel32.lib user32.lib gdi32.lib version.lib comdlg32.lib comctl32.lib advapi32.lib shell32.lib ole32.lib uuid.lib /nologo /machine:I386 /nodefaultlib
# SUBTRACT LINK32 /incremental:yes
-RSC_PROJ= /l 0x409 /d "FEAT_GUI_W32"
-# ADD RSC /l 0x409 /d "FEAT_GUI_W32"
+RSC_PROJ= /l 0x409 /d "FEAT_GUI"
+# ADD RSC /l 0x409 /d "FEAT_GUI"
!IF "$(CFG)" == "Vim - Win32 Release gvim OLE"
VIM=gvim
EXTRAS="$(INTDIR)/if_ole.obj" "$(INTDIR)/vim.res" "$(INTDIR)/gui.obj" "$(INTDIR)/gui_w32.obj" "$(INTDIR)/gui_beval.obj" "$(INTDIR)/os_w32exe.obj"
-CPP_PROJ=$(CPP_PROJ) /Zi /O2 /D "NDEBUG" /D "FEAT_GUI_W32" /D "DYNAMIC_GETTEXT" /D "FEAT_OLE" /Fd.\oleRel/ /Fo.\oleRel/
-# ADD CPP /Zi /O2 /D "NDEBUG" /D "FEAT_GUI_W32" /D "DYNAMIC_GETTEXT" /D "FEAT_OLE" /Fd.\oleRel/ /Fo.\oleRel/
+CPP_PROJ=$(CPP_PROJ) /Zi /O2 /D "NDEBUG" /D "FEAT_GUI" /D "DYNAMIC_GETTEXT" /D "FEAT_OLE" /Fd.\oleRel/ /Fo.\oleRel/
+# ADD CPP /Zi /O2 /D "NDEBUG" /D "FEAT_GUI" /D "DYNAMIC_GETTEXT" /D "FEAT_OLE" /Fd.\oleRel/ /Fo.\oleRel/
RSC_PROJ=$(RSC_PROJ) /I ".\oleRel" /d "NDEBUG" /d "FEAT_OLE" /fo.\oleRel\vim.res
# ADD RSC /I ".\oleRel" /d "NDEBUG" /d "FEAT_OLE" /fo.\oleRel\vim.res
VIM=gvimd
EXTRAS="$(INTDIR)/if_ole.obj" "$(INTDIR)/vim.res" "$(INTDIR)/gui.obj" "$(INTDIR)/gui_w32.obj" "$(INTDIR)/gui_beval.obj" "$(INTDIR)/os_w32exe.obj"
-CPP_PROJ=$(CPP_PROJ) /Zi /Od /D "_DEBUG" /D "FEAT_GUI_W32" /D "DYNAMIC_GETTEXT" /D "FEAT_OLE" /Fd.\oleDbg/ /Fo.\oleDbg/
-# ADD CPP /Zi /Od /D "_DEBUG" /D "FEAT_GUI_W32" /D "DYNAMIC_GETTEXT" /D "FEAT_OLE" /Fd.\oleDbg/ /Fo.\oleDbg/
+CPP_PROJ=$(CPP_PROJ) /Zi /Od /D "_DEBUG" /D "FEAT_GUI" /D "DYNAMIC_GETTEXT" /D "FEAT_OLE" /Fd.\oleDbg/ /Fo.\oleDbg/
+# ADD CPP /Zi /Od /D "_DEBUG" /D "FEAT_GUI" /D "DYNAMIC_GETTEXT" /D "FEAT_OLE" /Fd.\oleDbg/ /Fo.\oleDbg/
RSC_PROJ=$(RSC_PROJ) /I .\oleDbg /d "_DEBUG" /d "FEAT_OLE" /fo.\oleDbg\vim.res
# ADD RSC /I .\oleDbg /d "_DEBUG" /d "FEAT_OLE" /fo.\oleDbg\vim.res
VIM=gvim
EXTRAS="$(INTDIR)/vim.res" "$(INTDIR)/gui.obj" "$(INTDIR)/gui_w32.obj" "$(INTDIR)/gui_beval.obj" "$(INTDIR)/os_w32exe.obj"
-CPP_PROJ=$(CPP_PROJ) /Zi /O2 /D "NDEBUG" /D "FEAT_GUI_W32" /Fd.\gRel/ /Fo.\gRel/
-# ADD CPP /Zi /O2 /D "NDEBUG" /D "FEAT_GUI_W32" /Fd.\gRel/ /Fo.\gRel/
+CPP_PROJ=$(CPP_PROJ) /Zi /O2 /D "NDEBUG" /D "FEAT_GUI" /Fd.\gRel/ /Fo.\gRel/
+# ADD CPP /Zi /O2 /D "NDEBUG" /D "FEAT_GUI" /Fd.\gRel/ /Fo.\gRel/
RSC_PROJ=$(RSC_PROJ) /d "NDEBUG" /fo.\gRel\vim.res
# ADD RSC /d "NDEBUG" /fo.\gRel\vim.res
VIM=gvimd
EXTRAS="$(INTDIR)/vim.res" "$(INTDIR)/gui.obj" "$(INTDIR)/gui_w32.obj" "$(INTDIR)/gui_beval.obj" "$(INTDIR)/os_w32exe.obj"
-CPP_PROJ=$(CPP_PROJ) /Zi /Od /D "_DEBUG" /D "FEAT_GUI_W32" /Fd.\gDbg/ /Fo.\gDbg/
-# ADD CPP /Zi /Od /D "_DEBUG" /D "FEAT_GUI_W32" /Fd.\gDbg/ /Fo.\gDbg/
+CPP_PROJ=$(CPP_PROJ) /Zi /Od /D "_DEBUG" /D "FEAT_GUI" /Fd.\gDbg/ /Fo.\gDbg/
+# ADD CPP /Zi /Od /D "_DEBUG" /D "FEAT_GUI" /Fd.\gDbg/ /Fo.\gDbg/
RSC_PROJ=$(RSC_PROJ) /d "_DEBUG" /fo.\gDbg\vim.res
# ADD RSC /d "_DEBUG" /fo.\gDbg\vim.res
# Begin Custom Build
"$(INTDIR)\if_ole.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\if_ole.h"
- cl.exe /nologo /MT /W3 /GX /I ".\proto" /D "WIN32" /c /Zi /O2 /D "NDEBUG" /D "FEAT_GUI_W32" /D "FEAT_OLE" /Fd.\oleRel/ /Fo.\oleRel/ /I ".\oleRel" .\if_ole.cpp
+ cl.exe /nologo /MT /W3 /GX /I ".\proto" /D "WIN32" /c /Zi /O2 /D "NDEBUG" /D "FEAT_GUI" /D "FEAT_OLE" /Fd.\oleRel/ /Fo.\oleRel/ /I ".\oleRel" .\if_ole.cpp
@rem This is the default rule with /I "$(IntDir)" added
# End Custom Build
# Begin Custom Build
"$(INTDIR)\if_ole.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\if_ole.h"
- cl.exe /nologo /MT /W3 /GX /I ".\proto" /D "WIN32" /c /Zi /Od /D "_DEBUG" /D "FEAT_GUI_W32" /D "FEAT_OLE" /Fd.\oleDbg/ /Fo.\oleDbg/ /I ".\oleDbg" .\if_ole.cpp
+ cl.exe /nologo /MT /W3 /GX /I ".\proto" /D "WIN32" /c /Zi /Od /D "_DEBUG" /D "FEAT_GUI" /D "FEAT_OLE" /Fd.\oleDbg/ /Fo.\oleDbg/ /I ".\oleDbg" .\if_ole.cpp
@rem This is the default rule with /I "$(IntDir)" added
# End Custom Build
!if "$(GUI)" == "yes"
SUBSYSTEM = windows
-CFLAGS = $(CFLAGS) -DFEAT_GUI_W32
-RCFLAGS = $(RCFLAGS) -DFEAT_GUI_W32
+CFLAGS = $(CFLAGS) -DFEAT_GUI
+RCFLAGS = $(RCFLAGS) -DFEAT_GUI
VIM = g$(VIM)
GUI_INCL = \
gui.h
int y;
unsigned int state; /* Button/Modifier key state */
# else
-# if !defined(FEAT_GUI_W32)
+# if !defined(FEAT_GUI_MSWIN)
Widget target; /* widget we are monitoring */
Widget balloonShell;
Widget balloonLabel;
BeState showState; /* tells us whats currently going on */
# endif
# endif
-# if !defined(FEAT_GUI_GTK) && !defined(FEAT_GUI_W32)
+# if !defined(FEAT_GUI_GTK) && !defined(FEAT_GUI_MSWIN)
Dimension screen_width; /* screen width in pixels */
Dimension screen_height; /* screen height in pixels */
# endif
int *vts; // vartabstop setting for this buffer
#endif
char_u *msg;
-#ifdef FEAT_GUI_W32
+#ifdef FEAT_GUI_MSWIN
void *tofree;
#endif
} BalloonEval;
char_u uc[8];
} block8;
-#if defined(WIN3264)
+#if defined(MSWIN)
/* MS-Windows is always little endian */
#else
# ifdef HAVE_CONFIG_H
#endif
/* Note: when making changes here also adjust configure.ac. */
-#ifdef WIN32
+#ifdef MSWIN
/* WinSock API is separated from C API, thus we can't use read(), write(),
* errno... */
# define SOCK_ERRNO errno = WSAGetLastError()
static char *part_names[] = {"sock", "out", "err", "in"};
-#ifdef WIN32
+#ifdef MSWIN
static int
fd_read(sock_T fd, char *buf, size_t len)
{
}
}
-#ifdef _WIN32
+#ifdef MSWIN
# undef PERROR
# define PERROR(msg) (void)semsg("%s: %s", msg, strerror_win32(errno))
int sd = -1;
struct sockaddr_in server;
struct hostent *host;
-#ifdef WIN32
+#ifdef MSWIN
u_short port = port_in;
u_long val = 1;
#else
channel_T *channel;
int ret;
-#ifdef WIN32
+#ifdef MSWIN
channel_init_winsock();
#endif
{
/* Make connect() non-blocking. */
if (
-#ifdef _WIN32
+#ifdef MSWIN
ioctlsocket(sd, FIONBIO, &val) < 0
#else
fcntl(sd, F_SETFL, O_NONBLOCK) < 0
/* If connect() didn't finish then try using select() to wait for the
* connection to be made. For Win32 always use select() to wait. */
-#ifndef WIN32
+#ifndef MSWIN
if (errno != ECONNREFUSED)
#endif
{
struct timeval tv;
fd_set rfds;
fd_set wfds;
-#ifndef WIN32
+#ifndef MSWIN
int so_error = 0;
socklen_t so_error_len = sizeof(so_error);
struct timeval start_tv;
tv.tv_sec = waitnow / 1000;
tv.tv_usec = (waitnow % 1000) * 1000;
-#ifndef WIN32
+#ifndef MSWIN
gettimeofday(&start_tv, NULL);
#endif
ch_log(channel,
return NULL;
}
-#ifdef WIN32
+#ifdef MSWIN
/* On Win32: select() is expected to work and wait for up to
* "waitnow" msec for the socket to be open. */
if (FD_ISSET(sd, &wfds))
#endif
}
-#ifndef WIN32
+#ifndef MSWIN
if (waittime > 1 && elapsed_msec < waittime)
{
/* The port isn't ready but we also didn't get an error.
if (waittime >= 0)
{
-#ifdef _WIN32
+#ifdef MSWIN
val = 0;
ioctlsocket(sd, FIONBIO, &val);
#else
&& (part == PART_OUT || channel->CH_OUT_FD != *fd)
&& (part == PART_ERR || channel->CH_ERR_FD != *fd))
{
-#ifdef WIN32
+#ifdef MSWIN
if (channel->ch_named_pipe)
DisconnectNamedPipe((HANDLE)fd);
#endif
in_part->ch_block_write = 1;
/* TODO: Win32 implementation, probably using WaitForMultipleObjects() */
-#ifndef WIN32
+#ifndef MSWIN
{
# if defined(HAVE_SELECT)
struct timeval tval;
{
if (*p == NUL)
*p = NL;
-#ifdef WIN32
+#ifdef MSWIN
else if (*p == 0x1b)
{
// crush the escape sequence OSC 0/1/2: ESC ]0;
(int)buflen);
reader.js_used = 0;
chanpart->ch_wait_len = buflen;
-#ifdef WIN32
+#ifdef MSWIN
chanpart->ch_deadline = GetTickCount() + 100L;
#else
gettimeofday(&chanpart->ch_deadline, NULL);
else
{
int timeout;
-#ifdef WIN32
+#ifdef MSWIN
timeout = GetTickCount() > chanpart->ch_deadline;
#else
{
if (timeout > 0)
ch_log(channel, "Waiting for up to %d msec", timeout);
-# ifdef WIN32
+# ifdef MSWIN
if (fd != channel->CH_SOCK_FD)
{
DWORD nread;
timeout = timeout_arg;
if (chanpart->ch_wait_len > 0)
{
-#ifdef WIN32
+#ifdef MSWIN
timeout = chanpart->ch_deadline - GetTickCount() + 1;
#else
{
free_job_options(&opt);
}
-# if defined(WIN32) || defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK) \
+# if defined(MSWIN) || defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK) \
|| defined(PROTO)
/*
* Lookup the channel from the socket. Set "partp" to the fd index.
}
# endif
-# if defined(WIN32) || defined(FEAT_GUI) || defined(PROTO)
+# if defined(MSWIN) || defined(FEAT_GUI) || defined(PROTO)
/*
* Check the channels for anything that is ready to be read.
* The data is put in the read queue.
if (fd != INVALID_FD)
{
-#ifdef _WIN32
+#ifdef MSWIN
u_long val = 1;
ioctlsocket(fd, FIONBIO, &val);
else
{
res = fd_write(fd, (char *)buf, len);
-#ifdef WIN32
+#ifdef MSWIN
if (channel->ch_named_pipe && res < 0)
{
DisconnectNamedPipe((HANDLE)fd);
}
# endif /* UNIX && !HAVE_SELECT */
-# if (!defined(WIN32) && defined(HAVE_SELECT)) || defined(PROTO)
+# if (!defined(MSWIN) && defined(HAVE_SELECT)) || defined(PROTO)
/*
* The "fd_set" type is hidden to avoid problems with the function proto.
return ret;
}
-# endif /* !WIN32 && HAVE_SELECT */
+# endif /* !MSWIN && HAVE_SELECT */
/*
* Execute queued up commands.
break;
opt->jo_cwd = tv_get_string_buf_chk(item, opt->jo_cwd_buf);
if (opt->jo_cwd == NULL || !mch_isdir(opt->jo_cwd)
-#ifndef WIN32 // Win32 directories don't have the concept of "executable"
+#ifndef MSWIN // Win32 directories don't have the concept of "executable"
|| mch_access((char *)opt->jo_cwd, X_OK) != 0
#endif
)
#ifdef UNIX
vim_free(job->jv_termsig);
#endif
-#ifdef WIN3264
+#ifdef MSWIN
vim_free(job->jv_tty_type);
#endif
free_callback(job->jv_exit_cb, job->jv_exit_partial);
#ifdef UNIX
dict_add_string(dict, "termsig", job->jv_termsig);
#endif
-#ifdef WIN3264
+#ifdef MSWIN
dict_add_string(dict, "tty_type", job->jv_tty_type);
#endif
did_cursorhold = TRUE;
break;
-#ifdef FEAT_GUI_W32
- /* On Win32 ignore <M-F4>, we get it when closing the window was
- * cancelled. */
+#ifdef FEAT_GUI_MSWIN
+ /* On MS-Windows ignore <M-F4>, we get it when closing the window
+ * was cancelled. */
case K_F4:
if (mod_mask != MOD_MASK_ALT)
goto normalchar;
# ifdef UNIX
vim_snprintf((char *)buf, NUMBUFLEN,
"process %ld %s", (long)job->jv_pid, status);
-# elif defined(WIN32)
+# elif defined(MSWIN)
vim_snprintf((char *)buf, NUMBUFLEN,
"process %ld %s",
(long)job->jv_proc_info.dwProcessId,
#if defined(FEAT_MODIFY_FNAME) || defined(FEAT_EVAL) || defined(PROTO)
-#ifdef WIN3264
+#ifdef MSWIN
/*
* Functions for ":8" filename modifier: get 8.3 version of a filename.
*/
return OK;
}
-#endif /* WIN3264 */
+#endif // MSWIN
/*
* Adjust a filename, according to a string of modifiers.
char_u dirname[MAXPATHL];
int c;
int has_fullname = 0;
-#ifdef WIN3264
+#ifdef MSWIN
char_u *fname_start = *fnamep;
int has_shortname = 0;
#endif
return -1;
}
-#ifdef WIN3264
+#ifdef MSWIN
# if _WIN32_WINNT >= 0x0500
if (vim_strchr(*fnamep, '~') != NULL)
{
*usedlen += 2;
if (c == '8')
{
-#ifdef WIN3264
+#ifdef MSWIN
has_shortname = 1; /* Postpone this. */
#endif
continue;
if (src[*usedlen] == ':' && src[*usedlen + 1] == '8')
{
*usedlen += 2;
-#ifdef WIN3264
+#ifdef MSWIN
has_shortname = 1;
#endif
}
-#ifdef WIN3264
+#ifdef MSWIN
/*
* Handle ":8" after we have done 'heads' and before we do 'tails'.
*/
*fnamelen = l;
}
}
-#endif /* WIN3264 */
+#endif // MSWIN
/* ":t" - tail, just the basename */
if (src[*usedlen] == ':' && src[*usedlen + 1] == 't')
static void f_count(typval_T *argvars, typval_T *rettv);
static void f_cscope_connection(typval_T *argvars, typval_T *rettv);
static void f_cursor(typval_T *argsvars, typval_T *rettv);
-#ifdef WIN3264
+#ifdef MSWIN
static void f_debugbreak(typval_T *argvars, typval_T *rettv);
#endif
static void f_deepcopy(typval_T *argvars, typval_T *rettv);
{"count", 2, 4, f_count},
{"cscope_connection",0,3, f_cscope_connection},
{"cursor", 1, 3, f_cursor},
-#ifdef WIN3264
+#ifdef MSWIN
{"debugbreak", 1, 1, f_debugbreak},
#endif
{"deepcopy", 1, 2, f_deepcopy},
rettv->vval.v_number = 0;
}
-#ifdef WIN3264
+#ifdef MSWIN
/*
* "debugbreak()" function
*/
if (gui.in_use)
gui_mch_set_foreground();
#else
-# ifdef WIN32
+# ifdef MSWIN
win32_set_foreground();
# endif
#endif
#ifdef VMS
"vms",
#endif
-#ifdef WIN32
+#ifdef MSWIN
"win32",
#endif
#if defined(UNIX) && (defined(__CYGWIN32__) || defined(__CYGWIN__))
#endif
#ifdef FEAT_BEVAL_GUI
"balloon_eval",
-# ifndef FEAT_GUI_W32 /* other GUIs always have multiline balloons */
+# ifndef FEAT_GUI_MSWIN /* other GUIs always have multiline balloons */
"balloon_multiline",
# endif
#endif
# endif
#endif
#if defined(FEAT_BROWSE) && (defined(USE_FILE_CHOOSER) \
- || defined(FEAT_GUI_W32) \
+ || defined(FEAT_GUI_MSWIN) \
|| defined(FEAT_GUI_MOTIF))
"browsefilter",
#endif
#ifdef FEAT_GUI_PHOTON
"gui_photon",
#endif
-#ifdef FEAT_GUI_W32
+#ifdef FEAT_GUI_MSWIN
"gui_win32",
#endif
#ifdef FEAT_HANGULIN
#ifdef FEAT_TERMGUICOLORS
"termguicolors",
#endif
-#if defined(FEAT_TERMINAL) && !defined(WIN3264)
+#if defined(FEAT_TERMINAL) && !defined(MSWIN)
"terminal",
#endif
#ifdef TERMINFO
n = stdout_isatty;
else if (STRICMP(name, "multi_byte_encoding") == 0)
n = has_mbyte;
-#if defined(FEAT_BEVAL) && defined(FEAT_GUI_W32)
+#if defined(FEAT_BEVAL) && defined(FEAT_GUI_MSWIN)
else if (STRICMP(name, "balloon_multiline") == 0)
n = multiline_balloon_available();
#endif
else if (STRICMP(name, "netbeans_enabled") == 0)
n = netbeans_active();
#endif
-#if defined(FEAT_TERMINAL) && defined(WIN3264)
+#if defined(FEAT_TERMINAL) && defined(MSWIN)
else if (STRICMP(name, "terminal") == 0)
n = terminal_enabled();
#endif
-#if defined(FEAT_TERMINAL) && defined(WIN3264)
+#if defined(FEAT_TERMINAL) && defined(MSWIN)
else if (STRICMP(name, "conpty") == 0)
n = use_conpty();
#endif
return FAIL;
n1 = list_find_nr(arg->vval.v_list, 0L, &error);
n2 = list_find_nr(arg->vval.v_list, 1L, &error);
-# ifdef WIN3264
+# ifdef MSWIN
tm->HighPart = n1;
tm->LowPart = n2;
# else
{
long n1, n2;
-# ifdef WIN3264
+# ifdef MSWIN
n1 = res.HighPart;
n2 = res.LowPart;
# else
char_u *r = NULL;
char_u buf[NUMBUFLEN];
int timeout = 0;
-# ifdef WIN32
+# ifdef MSWIN
HWND w;
# else
Window w;
if (server_name == NULL)
return; /* type error; errmsg already given */
keys = tv_get_string_buf(&argvars[1], buf);
-# ifdef WIN32
+# ifdef MSWIN
if (serverSendToVim(server_name, keys, &r, &w, expr, timeout, TRUE) < 0)
# else
if (serverSendToVim(X_DISPLAY, server_name, keys, &r, &w, expr, timeout,
f_remote_foreground(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
{
#ifdef FEAT_CLIENTSERVER
-# ifdef WIN32
+# ifdef MSWIN
/* On Win32 it's done in this application. */
{
char_u *server_name = tv_get_string_chk(&argvars[0]);
#ifdef FEAT_CLIENTSERVER
dictitem_T v;
char_u *s = NULL;
-# ifdef WIN32
+# ifdef MSWIN
long_u n = 0;
# endif
char_u *serverid;
rettv->vval.v_number = -1;
return; /* type error; errmsg already given */
}
-# ifdef WIN32
+# ifdef MSWIN
sscanf((const char *)serverid, SCANF_HEX_LONG_U, &n);
if (n == 0)
rettv->vval.v_number = -1;
if (serverid != NULL && !check_restricted() && !check_secure())
{
int timeout = 0;
-# ifdef WIN32
+# ifdef MSWIN
/* The server's HWND is encoded in the 'id' parameter */
long_u n = 0;
# endif
if (argvars[1].v_type != VAR_UNKNOWN)
timeout = tv_get_number(&argvars[1]);
-# ifdef WIN32
+# ifdef MSWIN
sscanf((char *)serverid, SCANF_HEX_LONG_U, &n);
if (n != 0)
r = serverGetReply((HWND)n, FALSE, TRUE, TRUE, timeout);
char_u *r = NULL;
#ifdef FEAT_CLIENTSERVER
-# ifdef WIN32
+# ifdef MSWIN
r = serverGetVimNames();
# else
make_connection();
*/
#ifndef FEAT_GUI_MSWIN
if (cmd == NULL
-# ifdef WIN3264
+# ifdef MSWIN
|| (winstart && !need_wait_return)
# endif
)
# endif
no_wait_return = save_nwr;
}
-#endif /* FEAT_GUI_W32 */
+#endif /* FEAT_GUI_MSWIN */
#ifdef MSWIN
if (!winstart) /* if winstart==TRUE, never stopped termcap! */
int shortname = FALSE; /* use 8.3 file name */
stat_T st_old; /* mch_stat() of existing viminfo file */
#endif
-#ifdef WIN3264
+#ifdef MSWIN
int hidden = FALSE;
#endif
goto end;
}
#endif
-#ifdef WIN3264
+#ifdef MSWIN
/* Get the file attributes of the existing viminfo file. */
hidden = mch_ishidden(fname);
#endif
++viminfo_errcnt;
semsg(_("E886: Can't rename viminfo file to %s!"), fname);
}
-# ifdef WIN3264
+# ifdef MSWIN
/* If the viminfo file was hidden then also hide the new file. */
else if (hidden)
mch_hide(fname);
void
profile_start(proftime_T *tm)
{
-# ifdef WIN3264
+# ifdef MSWIN
QueryPerformanceCounter(tm);
# else
gettimeofday(tm, NULL);
{
proftime_T now;
-# ifdef WIN3264
+# ifdef MSWIN
QueryPerformanceCounter(&now);
tm->QuadPart = now.QuadPart - tm->QuadPart;
# else
void
profile_sub(proftime_T *tm, proftime_T *tm2)
{
-# ifdef WIN3264
+# ifdef MSWIN
tm->QuadPart -= tm2->QuadPart;
# else
tm->tv_usec -= tm2->tv_usec;
{
static char buf[50];
-# ifdef WIN3264
+# ifdef MSWIN
LARGE_INTEGER fr;
QueryPerformanceFrequency(&fr);
float_T
profile_float(proftime_T *tm)
{
-# ifdef WIN3264
+# ifdef MSWIN
LARGE_INTEGER fr;
QueryPerformanceFrequency(&fr);
profile_zero(tm);
else
{
-# ifdef WIN3264
+# ifdef MSWIN
LARGE_INTEGER fr;
QueryPerformanceCounter(tm);
{
proftime_T now;
-# ifdef WIN3264
+# ifdef MSWIN
if (tm->QuadPart == 0) /* timer was not set */
return FALSE;
QueryPerformanceCounter(&now);
void
profile_zero(proftime_T *tm)
{
-# ifdef WIN3264
+# ifdef MSWIN
tm->QuadPart = 0;
# else
tm->tv_usec = 0;
long
proftime_time_left(proftime_T *due, proftime_T *now)
{
-# ifdef WIN3264
+# ifdef MSWIN
LARGE_INTEGER fr;
if (now->QuadPart > due->QuadPart)
profile_zero(tm2);
else
{
-# ifdef WIN3264
+# ifdef MSWIN
tm2->QuadPart = tm->QuadPart / count;
# else
double usec = (tm->tv_sec * 1000000.0 + tm->tv_usec) / count;
void
profile_add(proftime_T *tm, proftime_T *tm2)
{
-# ifdef WIN3264
+# ifdef MSWIN
tm->QuadPart += tm2->QuadPart;
# else
tm->tv_usec += tm2->tv_usec;
{
/* Check that the result won't be negative. Can happen with recursive
* calls. */
-#ifdef WIN3264
+#ifdef MSWIN
if (total->QuadPart <= children->QuadPart)
return;
#else
int
profile_equal(proftime_T *tm1, proftime_T *tm2)
{
-# ifdef WIN3264
+# ifdef MSWIN
return (tm1->QuadPart == tm2->QuadPart);
# else
return (tm1->tv_usec == tm2->tv_usec && tm1->tv_sec == tm2->tv_sec);
int
profile_cmp(const proftime_T *tm1, const proftime_T *tm2)
{
-# ifdef WIN3264
+# ifdef MSWIN
return (int)(tm2->QuadPart - tm1->QuadPart);
# else
if (tm1->tv_sec == tm2->tv_sec)
static char_u *get_one_sourceline(struct source_cookie *sp);
-#if (defined(WIN32) && defined(FEAT_CSCOPE)) || defined(HAVE_FD_CLOEXEC)
+#if (defined(MSWIN) && defined(FEAT_CSCOPE)) || defined(HAVE_FD_CLOEXEC)
# define USE_FOPEN_NOINH
/*
* Special function to open a file without handle inheritance.
static FILE *
fopen_noinh_readbin(char *filename)
{
-# ifdef WIN32
+# ifdef MSWIN
int fd_tmp = mch_open(filename, O_RDONLY | O_BINARY | O_NOINHERIT, 0);
# else
int fd_tmp = mch_open(filename, O_RDONLY, 0);
/* Obtain the locale value from the libraries. */
loc = (char_u *)setlocale(what, NULL);
-# ifdef WIN32
+# ifdef MSWIN
if (loc != NULL)
{
char_u *p;
#endif
-#ifdef WIN32
+#ifdef MSWIN
/*
* On MS-Windows locale names are strings like "German_Germany.1252", but
* gettext expects "de". Try to translate one into another here for a few
p = mch_getenv((char_u *)"LANG");
}
# endif
-# ifdef WIN32
+# ifdef MSWIN
p = gettext_lang(p);
# endif
return is_valid_mess_lang(p) ? p : NULL;
/* Clear $LANGUAGE because GNU gettext uses it. */
vim_setenv((char_u *)"LANGUAGE", (char_u *)"");
-# ifdef WIN32
+# ifdef MSWIN
/* Apparently MS-Windows printf() may cause a crash when
* we give it 8-bit text while it's expecting text in the
* current locale. This call avoids that. */
if (what != LC_CTYPE)
{
char_u *mname;
-#ifdef WIN32
+#ifdef MSWIN
mname = gettext_lang(name);
#else
mname = name;
static char_u **locales = NULL; /* Array of all available locales */
-# ifndef WIN32
+# ifndef MSWIN
static int did_init_locales = FALSE;
/* Return an array of strings for all available locales + NULL for the
static void
init_locales(void)
{
-# ifndef WIN32
+# ifndef MSWIN
if (!did_init_locales)
{
did_init_locales = TRUE;
# define ex_gui ex_nogui
static void ex_nogui(exarg_T *eap);
#endif
-#if defined(FEAT_GUI_W32) && defined(FEAT_MENU) && defined(FEAT_TEAROFF)
+#if defined(FEAT_GUI_MSWIN) && defined(FEAT_MENU) && defined(FEAT_TEAROFF)
static void ex_tearoff(exarg_T *eap);
#else
# define ex_tearoff ex_ni
}
#endif
-#if defined(FEAT_GUI_W32) && defined(FEAT_MENU) && defined(FEAT_TEAROFF)
+#if defined(FEAT_GUI_MSWIN) && defined(FEAT_MENU) && defined(FEAT_TEAROFF)
static void
ex_tearoff(exarg_T *eap)
{
if (need_maketitle)
maketitle();
#endif
-#if defined(WIN3264) && !defined(FEAT_GUI_W32)
+#if defined(MSWIN) && !defined(FEAT_GUI_MSWIN)
resize_console_buf();
#endif
RedrawingDisabled = r;
/* Ignore mouse event or open_cmdwin() result. */
goto cmdline_not_changed;
-#ifdef FEAT_GUI_W32
- /* On Win32 ignore <M-F4>, we get it when closing the window was
- * cancelled. */
+#ifdef FEAT_GUI_MSWIN
+ /* On MS-Windows ignore <M-F4>, we get it when closing the window
+ * was cancelled. */
case K_F4:
if (mod_mask == MOD_MASK_ALT)
{
*/
#if !defined(FEAT_TINY) && !defined(FEAT_SMALL) && !defined(FEAT_NORMAL) \
&& !defined(FEAT_BIG) && !defined(FEAT_HUGE)
-# if defined(UNIX) || defined(WIN3264) || defined(MACOS_X)
+# if defined(UNIX) || defined(MSWIN) || defined(MACOS_X)
# define FEAT_HUGE
# else
# if defined(MSWIN) || defined(VMS) || defined(AMIGA)
*/
#ifdef FEAT_NORMAL
# define FEAT_EVAL
-# if defined(HAVE_FLOAT_FUNCS) || defined(WIN3264) || defined(MACOS_X)
+# if defined(HAVE_FLOAT_FUNCS) || defined(MSWIN) || defined(MACOS_X)
# define FEAT_FLOAT
# endif
-# if defined(HAVE_STDINT_H) || defined(WIN3264) || (VIM_SIZEOF_LONG >= 8)
+# if defined(HAVE_STDINT_H) || defined(MSWIN) || (VIM_SIZEOF_LONG >= 8)
# define FEAT_NUM64
# endif
#endif
#if defined(FEAT_HUGE) \
&& defined(FEAT_EVAL) \
&& ((defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)) \
- || defined(WIN3264))
+ || defined(MSWIN))
# define FEAT_PROFILE
#endif
#if defined(FEAT_NORMAL) \
&& defined(FEAT_EVAL) \
&& ((defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)) \
- || defined(WIN3264))
+ || defined(MSWIN))
# define FEAT_RELTIME
#endif
/*
* +timers timer_start()
*/
-#if defined(FEAT_RELTIME) && (defined(UNIX) || defined(WIN32) || defined(VMS) )
+#if defined(FEAT_RELTIME) && (defined(UNIX) || defined(MSWIN) || defined(VMS) )
# define FEAT_TIMERS
#endif
* +multi_byte_ime Win32 IME input method. Only for far-east Windows, so
* IME can be used to input chars. Not tested much!
*/
-#if defined(FEAT_GUI_W32) && !defined(FEAT_MBYTE_IME)
+#if defined(FEAT_GUI_MSWIN) && !defined(FEAT_MBYTE_IME)
/* #define FEAT_MBYTE_IME */
# endif
#if defined(HAVE_DLOPEN) && defined(HAVE_DLSYM)
# define USE_DLOPEN
#endif
-#if defined(FEAT_EVAL) && (defined(WIN3264) || ((defined(UNIX) || defined(VMS)) \
+#if defined(FEAT_EVAL) && (defined(MSWIN) || ((defined(UNIX) || defined(VMS)) \
&& (defined(USE_DLOPEN) || defined(HAVE_SHL_LOAD))))
# define FEAT_LIBCALL
#endif
*/
#ifdef FEAT_NORMAL
# define FEAT_MENU
-# ifdef FEAT_GUI_W32
+# ifdef FEAT_GUI_MSWIN
# define FEAT_TEAROFF
# endif
#endif
#endif
#if !defined(FEAT_GUI_DIALOG) && (defined(FEAT_GUI_MOTIF) \
|| defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_GTK) \
- || defined(FEAT_GUI_W32))
+ || defined(FEAT_GUI_MSWIN))
/* need a dialog to show error messages when starting from the desktop */
# define FEAT_GUI_DIALOG
#endif
*/
#if defined(FEAT_NORMAL) \
&& ((defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)) \
- || defined(WIN3264))
+ || defined(MSWIN))
# define STARTUPTIME 1
#endif
# ifdef FEAT_BIG
# define FEAT_MOUSE_SGR
# endif
-# if defined(FEAT_NORMAL) && defined(WIN3264)
+# if defined(FEAT_NORMAL) && defined(MSWIN)
# define DOS_MOUSE
# endif
# if defined(FEAT_NORMAL) && defined(__QNX__)
* +clientserver Remote control via the remote_send() function
* and the --remote argument
*/
-#if (defined(WIN32) || defined(FEAT_XCLIPBOARD)) && defined(FEAT_EVAL)
+#if (defined(MSWIN) || defined(FEAT_XCLIPBOARD)) && defined(FEAT_EVAL)
# define FEAT_CLIENTSERVER
#endif
* when --servername is not passed on the command line.
*/
#if defined(FEAT_CLIENTSERVER) && !defined(FEAT_AUTOSERVERNAME)
-# ifdef WIN3264
+# ifdef MSWIN
/* Always enabled on MS-Windows. */
# define FEAT_AUTOSERVERNAME
# else
*/
#ifdef FEAT_NORMAL
/* MS-DOS console and Win32 console can change cursor shape */
-# if defined(WIN3264) && !defined(FEAT_GUI_W32)
+# if defined(MSWIN) && !defined(FEAT_GUI_MSWIN)
# define MCH_CURSOR_SHAPE
# endif
-# if defined(FEAT_GUI_W32) || defined(FEAT_GUI_MOTIF) \
+# if defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_MOTIF) \
|| defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_GTK) \
|| defined(FEAT_GUI_PHOTON)
# define FEAT_MOUSESHAPE
# define CURSOR_SHAPE
#endif
-#if defined(FEAT_MZSCHEME) && (defined(FEAT_GUI_W32) || defined(FEAT_GUI_GTK) \
+#if defined(FEAT_MZSCHEME) && (defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_GTK) \
|| defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA) \
|| defined(FEAT_GUI_MAC))
# define MZSCHEME_GUI_THREADS
# if ((defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA)) \
&& defined(HAVE_X11_XPM_H)) \
|| defined(FEAT_GUI_GTK) \
- || (defined(WIN32) && defined(FEAT_GUI))
+ || (defined(MSWIN) && defined(FEAT_GUI))
# define FEAT_SIGN_ICONS
# endif
#endif
* Only for GUIs where it was implemented.
*/
#if (defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA) \
- || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_W32)) \
+ || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_MSWIN)) \
&& ( ((defined(FEAT_TOOLBAR) || defined(FEAT_GUI_TABLINE)) \
- && !defined(FEAT_GUI_GTK) && !defined(FEAT_GUI_W32)) \
+ && !defined(FEAT_GUI_GTK) && !defined(FEAT_GUI_MSWIN)) \
|| defined(FEAT_NETBEANS_INTG) || defined(FEAT_EVAL))
# define FEAT_BEVAL_GUI
# if !defined(FEAT_XFONTSET) && !defined(FEAT_GUI_GTK) \
- && !defined(FEAT_GUI_W32)
+ && !defined(FEAT_GUI_MSWIN)
# define FEAT_XFONTSET
# endif
#endif
* +balloon_eval_term Allow balloon expression evaluation in the terminal.
*/
#if defined(FEAT_HUGE) && defined(FEAT_TIMERS) && \
- (defined(UNIX) || defined(VMS) || (defined(WIN32) && !defined(FEAT_GUI_W32)))
+ (defined(UNIX) || defined(VMS) || (defined(MSWIN) && !defined(FEAT_GUI_MSWIN)))
# define FEAT_BEVAL_TERM
#endif
* +filterpipe
*/
#if (defined(UNIX) && !defined(USE_SYSTEM)) \
- || (defined(WIN3264) && defined(FEAT_GUI_W32))
+ || (defined(MSWIN) && defined(FEAT_GUI_MSWIN))
# define FEAT_FILTERPIPE
#endif
/*
* +vtp: Win32 virtual console.
*/
-#if !defined(FEAT_GUI) && defined(WIN3264)
+#if !defined(FEAT_GUI) && defined(MSWIN)
# define FEAT_VTP
#endif
#define FIO_UCS2 0x04 /* convert UCS-2 */
#define FIO_UCS4 0x08 /* convert UCS-4 */
#define FIO_UTF16 0x10 /* convert UTF-16 */
-#ifdef WIN3264
+#ifdef MSWIN
# define FIO_CODEPAGE 0x20 /* convert MS-Windows codepage */
# define FIO_PUT_CP(x) (((x) & 0xffff) << 16) /* put codepage in top word */
# define FIO_GET_CP(x) (((x)>>16) & 0xffff) /* get codepage from top word */
static int get_fio_flags(char_u *ptr);
static char_u *check_for_bom(char_u *p, long size, int *lenp, int flags);
static int make_bom(char_u *buf, char_u *name);
-#ifdef WIN3264
+#ifdef MSWIN
static int get_win_fio_flags(char_u *ptr);
#endif
#ifdef MACOS_CONVERT
else if (enc_utf8 || STRCMP(p_enc, "latin1") == 0)
fio_flags = get_fio_flags(fenc);
-#ifdef WIN3264
+#ifdef MSWIN
/*
* Conversion from an MS-Windows codepage to UTF-8 or another codepage
* is handled with MultiByteToWideChar().
size = (size * 2 / 3) & ~3;
else if (fio_flags == FIO_UCSBOM)
size = size / ICONV_MULT; /* worst case */
-#ifdef WIN3264
+#ifdef MSWIN
else if (fio_flags & FIO_CODEPAGE)
size = size / ICONV_MULT; /* also worst case */
#endif
}
#endif
-#ifdef WIN3264
+#ifdef MSWIN
if (fio_flags & FIO_CODEPAGE)
{
char_u *src, *dst;
curbuf->b_op_end.lnum = from + linecnt;
curbuf->b_op_end.col = 0;
-#ifdef WIN32
+#ifdef MSWIN
/*
* Work around a weird problem: When a file has two links (only
* possible on NTFS) and we write through one link, then stat() it
*/
if (!(append && *p_pm == NUL) && !filtering && perm >= 0 && dobackup)
{
-#if defined(UNIX) || defined(WIN32)
+#if defined(UNIX) || defined(MSWIN)
stat_T st;
#endif
if ((bkc & BKC_YES) || append) /* "yes" */
backup_copy = TRUE;
-#if defined(UNIX) || defined(WIN32)
+#if defined(UNIX) || defined(MSWIN)
else if ((bkc & BKC_AUTO)) /* "auto" */
{
int i;
backup_copy = TRUE;
else
# else
-# ifdef WIN32
+# ifdef MSWIN
/* On NTFS file systems hard links are possible. */
if (mch_is_linked(fname))
backup_copy = TRUE;
&& (lstat_res != 0 || st.st_ino == st_old.st_ino))
backup_copy = FALSE;
# else
-# if defined(WIN32)
+# if defined(MSWIN)
/* Symlinks. */
if ((bkc & BKC_BREAKSYMLINK) && mch_is_symbolic_link(fname))
backup_copy = FALSE;
stat_T st_new;
char_u *dirp;
char_u *rootname;
-#if defined(UNIX) || defined(WIN3264)
+#if defined(UNIX) || defined(MSWIN)
char_u *p;
#endif
#if defined(UNIX)
*/
(void)copy_option_part(&dirp, copybuf, BUFSIZE, ",");
-#if defined(UNIX) || defined(WIN3264)
+#if defined(UNIX) || defined(MSWIN)
p = copybuf + STRLEN(copybuf);
if (after_pathsep(copybuf, p) && p[-1] == p[-2])
// Ends with '//', use full path
*/
(void)copy_option_part(&dirp, IObuff, IOSIZE, ",");
-#if defined(UNIX) || defined(WIN3264)
+#if defined(UNIX) || defined(MSWIN)
p = IObuff + STRLEN(IObuff);
if (after_pathsep(IObuff, p) && p[-1] == p[-2])
// path ends with '//', use full path
}
}
-#ifdef WIN3264
+#ifdef MSWIN
if (converted && wb_flags == 0 && (wb_flags = get_win_fio_flags(fenc)) != 0)
{
/* Convert UTF-8 -> UCS-2 and UCS-2 -> DBCS. Worst-case * 4: */
vim_ignored = ftruncate(fd, (off_t)0);
#endif
-#if defined(WIN3264)
+#if defined(MSWIN)
if (backup != NULL && overwriting && !append)
{
if (backup_copy)
}
}
-#ifdef WIN3264
+#ifdef MSWIN
else if (flags & FIO_CODEPAGE)
{
/*
return 0;
}
-#ifdef WIN3264
+#ifdef MSWIN
/*
* Check "ptr" for a MS-Windows codepage name and return the FIO_ flags needed
* for the conversion MS-Windows can do for us. Also accept "utf-8".
p = full_path + len;
#if defined(MSWIN)
/*
- * MSWIN: when a file is in the root directory, dir_name will end in a
- * slash, since C: by itself does not define a specific dir. In this
- * case p may already be correct. <negri>
+ * MS-Windows: when a file is in the root directory, dir_name will end
+ * in a slash, since C: by itself does not define a specific dir. In
+ * this case p may already be correct. <negri>
*/
if (!((len > 2) && (*(p - 2) == ':')))
#endif
else if ((int)STRLEN(e) + extlen > 4)
s = e + 4 - extlen;
}
-#ifdef WIN3264
+#ifdef MSWIN
/*
* If there is no file name, and the extension starts with '.', put a
* '_' before the dot, because just ".ext" may be invalid if it's on a
use_tmp_file = TRUE;
}
#endif
-#ifdef WIN3264
+#ifdef MSWIN
{
BY_HANDLE_FILE_INFORMATION info1, info2;
/* A symbolic link to a directory itself is deleted, not the directory it
* points to. */
if (
-# if defined(UNIX) || defined(WIN32)
+# if defined(UNIX) || defined(MSWIN)
mch_isrealdir(name)
# else
mch_isdir(name)
{
#ifdef USE_TMPNAM
char_u itmp[L_tmpnam]; /* use tmpnam() */
-#elif defined(WIN3264)
+#elif defined(MSWIN)
WCHAR itmp[TEMPNAMELEN];
#else
char_u itmp[TEMPNAMELEN];
#else /* TEMPDIRNAMES */
-# ifdef WIN3264
+# ifdef MSWIN
WCHAR wszTempFile[_MAX_PATH + 1];
WCHAR buf4[4];
char_u *retval;
*p = '/';
return retval;
-# else /* WIN3264 */
+# else // MSWIN
# ifdef USE_TMPNAM
char_u *p;
# endif
return vim_strsave(itmp);
-# endif /* WIN3264 */
+# endif // MSWIN
#endif /* TEMPDIRNAMES */
}
}
c = TO_SPECIAL(c2, c);
-#if defined(FEAT_GUI_W32) && defined(FEAT_MENU) && defined(FEAT_TEAROFF)
+#if defined(FEAT_GUI_MSWIN) && defined(FEAT_MENU) && defined(FEAT_TEAROFF)
/* Handle K_TEAROFF here, the caller of vgetc() doesn't need to
* know that a menu was torn off */
if (c == K_TEAROFF)
case K_KMULTIPLY: c = '*'; break;
case K_KENTER: c = CAR; break;
case K_KPOINT:
-#ifdef WIN32
+#ifdef MSWIN
// Can be either '.' or a ',',
// depending on the type of keypad.
c = MapVirtualKey(VK_DECIMAL, 2); break;
if (p[0] == NUL || (p[0] == K_SPECIAL
/* timeout may generate K_CURSORHOLD */
&& (i < 2 || p[1] != KS_EXTRA || p[2] != (int)KE_CURSORHOLD)
-#if defined(WIN3264) && !defined(FEAT_GUI)
+#if defined(MSWIN) && !defined(FEAT_GUI)
/* Win32 console passes modifiers */
&& (i < 2 || p[1] != KS_MODIFIER)
#endif
if (pIApp == NULL || pIApp->OnDefWindowProc(hWnd, Msg,
wParam, lParam, &lResult) != S_OK)
{
-#if defined(WIN3264)
+#if defined(MSWIN)
if (wide_WindowProc)
lResult = DefWindowProcW(hWnd, Msg, wParam, lParam);
else
*/
EXTERN long Rows /* nr of rows in the screen */
#ifdef DO_INIT
-# if defined(WIN3264)
+# if defined(MSWIN)
= 25L
# else
= 24L
EXTERN int enc_unicode INIT(= 0); /* 2: UCS-2 or UTF-16, 4: UCS-4 */
EXTERN int enc_utf8 INIT(= FALSE); /* UTF-8 encoded Unicode */
EXTERN int enc_latin1like INIT(= TRUE); /* 'encoding' is latin1 comp. */
-#if defined(WIN3264) || defined(FEAT_CYGWIN_WIN32_CLIPBOARD)
+#if defined(MSWIN) || defined(FEAT_CYGWIN_WIN32_CLIPBOARD)
/* Codepage nr of 'encoding'. Negative means it's not been set yet, zero
* means 'encoding' is not a valid codepage. */
EXTERN int enc_codepage INIT(= -1);
#endif
EXTERN int has_mbyte INIT(= 0); /* any multi-byte encoding */
-#if defined(WIN3264)
+#if defined(MSWIN)
EXTERN int wide_WindowProc INIT(= FALSE); /* use wide WindowProc() */
#endif
EXTERN int echo_wid_arg INIT(= FALSE); /* --echo-wid argument */
#endif
-#ifdef FEAT_GUI_W32
+#ifdef FEAT_GUI_MSWIN
/*
* The value of the --windowid argument.
* For embedding gvim inside another application.
EXTERN int *eval_lavars_used INIT(= NULL);
#endif
-#ifdef WIN3264
+#ifdef MSWIN
EXTERN int ctrl_break_was_pressed INIT(= FALSE);
#endif
&general_beval_cb, NULL);
}
# else
-# ifdef FEAT_GUI_W32
+# ifdef FEAT_GUI_MSWIN
balloonEval = gui_mch_create_beval_area(NULL, NULL,
&general_beval_cb, NULL);
# endif
int curr_wide = FALSE; /* use 'guifontwide' */
int prev_wide = FALSE;
int wide_changed;
-# ifdef WIN3264
+# ifdef MSWIN
int sep_comp = FALSE; /* Don't separate composing chars. */
# else
int sep_comp = TRUE; /* Separate composing chars. */
/* Draw the sign on top of the spaces. */
gui_mch_drawsign(gui.row, col, gui.highlight_mask);
# if defined(FEAT_NETBEANS_INTG) && (defined(FEAT_GUI_X11) \
- || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_W32))
+ || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_MSWIN))
if (multi_sign)
netbeans_draw_multisign_indicator(gui.row);
# endif
fix_size = TRUE;
}
#endif
-#if defined(FEAT_MENU) && !(defined(WIN3264) && !defined(FEAT_TEAROFF))
+#if defined(FEAT_MENU) && !(defined(MSWIN) && !defined(FEAT_TEAROFF))
if (using_tearoff != prev_tearoff)
{
gui_mch_toggle_tearoffs(using_tearoff);
/* Update the horizontal scrollbar */
gui_update_horiz_scrollbar(force);
-#ifndef WIN3264
+#ifndef MSWIN
/* Return straight away if there is neither a left nor right scrollbar.
* On MS-Windows this is required anyway for scrollwheel messages. */
if (!gui.which_scrollbars[SBAR_LEFT] && !gui.which_scrollbars[SBAR_RIGHT])
/*
* Find window where the mouse pointer "x" / "y" coordinate is in.
+ * As a side effect update the shape of the mouse pointer.
*/
static win_T *
-xy2win(int x UNUSED, int y UNUSED)
+xy2win(int x, int y)
{
int row;
int col;
ex_next(eap);
}
-#if ((defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_W32) \
- || defined(FEAT_GUI_PHOTON)) && defined(FEAT_TOOLBAR)) || defined(PROTO)
+#if ((defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK) \
+ || defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_PHOTON)) \
+ && defined(FEAT_TOOLBAR)) || defined(PROTO)
/*
* This is shared between Athena, Motif and GTK.
*/
* X_2_COL - Convert X pixel coord into character column.
* Y_2_ROW - Convert Y pixel coord into character row.
*/
-#ifdef FEAT_GUI_W32
+#ifdef FEAT_GUI_MSWIN
# define TEXT_X(col) ((col) * gui.char_width)
# define TEXT_Y(row) ((row) * gui.char_height + gui.char_ascent)
# define FILL_X(col) ((col) * gui.char_width)
#endif /* FEAT_GUI_GTK */
#if defined(FEAT_GUI_TABLINE) \
- && (defined(FEAT_GUI_W32) || defined(FEAT_GUI_MOTIF) \
+ && (defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_MOTIF) \
|| defined(FEAT_GUI_MAC))
int tabline_height;
#endif
#if defined(FEAT_BEVAL_GUI) || defined(PROTO)
/* on Win32 only get_beval_info() is required */
-#if !defined(FEAT_GUI_W32) || defined(PROTO)
+#if !defined(FEAT_GUI_MSWIN) || defined(PROTO)
#ifdef FEAT_GUI_GTK
# if GTK_CHECK_VERSION(3,0,0)
return current_beval;
}
#endif
-#endif /* !FEAT_GUI_W32 */
+#endif /* !FEAT_GUI_MSWIN */
#if defined(FEAT_NETBEANS_INTG) || defined(FEAT_EVAL) || defined(PROTO)
-# if !defined(FEAT_GUI_W32) || defined(PROTO)
+# if !defined(FEAT_GUI_MSWIN) || defined(PROTO)
/*
* Show a balloon with "mesg".
else
undrawBalloon(beval);
}
-# endif /* !FEAT_GUI_W32 */
+# endif /* !FEAT_GUI_MSWIN */
#endif /* FEAT_NETBEANS_INTG || PROTO */
-#if !defined(FEAT_GUI_W32) || defined(PROTO)
+#if !defined(FEAT_GUI_MSWIN) || defined(PROTO)
#if defined(FEAT_BEVAL_TIP) || defined(PROTO)
/*
* Hide the given balloon.
}
#endif /* !FEAT_GUI_GTK */
-#endif /* !FEAT_GUI_W32 */
+#endif /* !FEAT_GUI_MSWIN */
#endif /* FEAT_BEVAL_GUI */
# include <gdk/gdkkeysyms.h>
# endif
# include <gdk/gdk.h>
-# ifdef WIN3264
+# ifdef MSWIN
# include <gdk/gdkwin32.h>
# else
# include <gdk/gdkx.h>
#if !GTK_CHECK_VERSION(3,0,0)
# include <gtk/gtksignal.h>
#endif
-#ifdef WIN3264
+#ifdef MSWIN
# include <gdk/gdkwin32.h>
#else
# include <gdk/gdkx.h>
# include <gdk/gdkkeysyms.h>
# endif
# include <gdk/gdk.h>
-# ifdef WIN3264
+# ifdef MSWIN
# include <gdk/gdkwin32.h>
# else
# include <gdk/gdkx.h>
goto add_err;
while (fname[strlen(fname)-1] == '/'
-#ifdef WIN32
+#ifdef MSWIN
|| fname[strlen(fname)-1] == '\\'
#endif
)
#endif
int len;
char *prog, *cmd, *ppath = NULL;
-#ifdef WIN32
+#ifdef MSWIN
int fd;
SECURITY_ATTRIBUTES sa;
PROCESS_INFORMATION pi;
(void)close(to_cs[1]);
(void)close(from_cs[0]);
#else
- /* WIN32 */
+ /* MSWIN */
/* Create pipes to communicate with cscope */
sa.nLength = sizeof(SECURITY_ATTRIBUTES);
sa.bInheritHandle = TRUE;
#ifdef UNIX
return CSCOPE_FAILURE;
#else
- /* WIN32 */
+ /* MSWIN */
goto err_closing;
#endif
}
#ifdef UNIX
return CSCOPE_FAILURE;
#else
- /* WIN32 */
+ /* MSWIN */
goto err_closing;
#endif
}
#ifdef UNIX
return CSCOPE_FAILURE;
#else
- /* WIN32 */
+ /* MSWIN */
goto err_closing;
#endif
}
#if defined(UNIX)
(void)sprintf(cmd, "exec %s -dl -f %s", prog, csinfo[i].fname);
#else
- /* WIN32 */
+ /* MSWIN */
(void)sprintf(cmd, "%s -dl -f %s", prog, csinfo[i].fname);
#endif
if (csinfo[i].ppath != NULL)
}
#else
- /* WIN32 */
+ /* MSWIN */
/* Create a new process to run cscope and use pipes to talk with it */
GetStartupInfo(&si);
si.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW;
csinfo[i].pid = 0;
csinfo[i].fr_fp = NULL;
csinfo[i].to_fp = NULL;
-#if defined(WIN32)
+#if defined(MSWIN)
csinfo[i].hProc = NULL;
#endif
}
s = path + strlen(path) - 1;
for (i = 0; i < p_cspc; ++i)
while (s > path && *--s != '/'
-#ifdef WIN32
+#ifdef MSWIN
&& *--s != '\\'
#endif
)
;
if ((s > path && *s == '/')
-#ifdef WIN32
+#ifdef MSWIN
|| (s > path && *s == '\\')
#endif
)
if (csinfo[i].ppath != NULL
&& (strncmp(name, csinfo[i].ppath, strlen(csinfo[i].ppath)) != 0)
&& (name[0] != '/')
-#ifdef WIN32
+#ifdef MSWIN
&& name[0] != '\\' && name[1] != ':'
#endif
)
#if defined(FEAT_CSCOPE) || defined(PROTO)
-#if defined (WIN32)
+#if defined (MSWIN)
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif
dev_t st_dev; /* ID of dev containing cscope db */
ino_t st_ino; /* inode number of cscope db */
#else
-# if defined(WIN32)
+# if defined(MSWIN)
DWORD pid; /* PID of the connected cscope process. */
HANDLE hProc; /* cscope process handle */
DWORD nVolume; /* Volume serial number, instead of st_dev */
#ifdef DYNAMIC_LUA
-#ifndef WIN3264
+#ifndef MSWIN
# include <dlfcn.h>
# define HANDLE void*
# define load_dll(n) dlopen((n), RTLD_LAZY|RTLD_GLOBAL)
* racket-6.3. See
* http://docs.racket-lang.org/inside/im_memoryalloc.html?q=scheme_register_tls_space
*/
-#if MZSCHEME_VERSION_MAJOR >= 500 && defined(WIN32) \
+#if MZSCHEME_VERSION_MAJOR >= 500 && defined(MSWIN) \
&& defined(USE_THREAD_LOCAL) \
&& (!defined(_WIN64) || MZSCHEME_VERSION_MAJOR >= 603)
# define HAVE_TLS_SPACE 1
/* MzScheme threads scheduling stuff */
static int mz_threads_allow = 0;
-#if defined(FEAT_GUI_W32)
+#if defined(FEAT_GUI_MSWIN)
static void CALLBACK timer_proc(HWND, UINT, UINT_PTR, DWORD);
static UINT timer_id = 0;
#elif defined(FEAT_GUI_GTK)
static EventLoopTimerUPP timerUPP;
#endif
-#ifndef FEAT_GUI_W32 /* Win32 console and Unix */
+#ifndef FEAT_GUI_MSWIN /* Win32 console and Unix */
void
mzvim_check_threads(void)
{
static void remove_timer(void);
/* timers are presented in GUI only */
-# if defined(FEAT_GUI_W32)
+# if defined(FEAT_GUI_MSWIN)
static void CALLBACK
timer_proc(HWND hwnd UNUSED, UINT uMsg UNUSED, UINT_PTR idEvent UNUSED, DWORD dwTime UNUSED)
# elif defined(FEAT_GUI_GTK)
static void
setup_timer(void)
{
-# if defined(FEAT_GUI_W32)
+# if defined(FEAT_GUI_MSWIN)
timer_id = SetTimer(NULL, 0, p_mzq, timer_proc);
# elif defined(FEAT_GUI_GTK)
timer_id = g_timeout_add((guint)p_mzq, (GSourceFunc)timer_proc, NULL);
static void
remove_timer(void)
{
-# if defined(FEAT_GUI_W32)
+# if defined(FEAT_GUI_MSWIN)
KillTimer(NULL, timer_id);
# elif defined(FEAT_GUI_GTK)
g_source_remove(timer_id);
* Do ":help credits" in Vim to see a list of people who contributed.
*/
-#if defined(FEAT_OLE) && defined(FEAT_GUI_W32)
+#if defined(FEAT_OLE) && defined(WIN32) && defined(FEAT_GUI)
/*
* OLE server implementation.
*
// Work around for ActivePerl 5.20.3+: Avoid generating (g)vim.lib.
#if defined(ACTIVEPERL_VERSION) && (ACTIVEPERL_VERSION >= 2003) \
- && defined(WIN32) && defined(USE_DYNAMIC_LOADING)
+ && defined(MSWIN) && defined(USE_DYNAMIC_LOADING)
# undef XS_EXTERNAL
# define XS_EXTERNAL(name) XSPROTO(name)
#endif
#if defined(DYNAMIC_PERL) || defined(PROTO)
# ifndef DYNAMIC_PERL /* just generating prototypes */
-# ifdef WIN3264
+# ifdef MSWIN
typedef int HANDLE;
# endif
typedef int XSINIT_t;
typedef int perl_key;
# endif
-# ifndef WIN3264
+# ifndef MSWIN
# include <dlfcn.h>
# define HANDLE void*
# define PERL_PROC void*
# undef _POSIX_THREADS
#endif
-#if defined(_WIN32) && defined(HAVE_FCNTL_H)
+#if defined(MSWIN) && defined(HAVE_FCNTL_H)
# undef HAVE_FCNTL_H
#endif
# define HINSTANCE long_u /* for generating prototypes */
# endif
-# ifndef WIN3264
+# ifndef MSWIN
# include <dlfcn.h>
# define FARPROC void*
# define HINSTANCE void*
#include <limits.h>
-#if defined(_WIN32) && defined(HAVE_FCNTL_H)
+#if defined(MSWIN) && defined(HAVE_FCNTL_H)
# undef HAVE_FCNTL_H
#endif
#if defined(DYNAMIC_PYTHON3) || defined(PROTO)
-# ifndef WIN3264
+# ifndef MSWIN
# include <dlfcn.h>
# define FARPROC void*
# define HINSTANCE void*
# define RUBY_EXPORT
# endif
-#if !(defined(WIN32) || defined(_WIN64))
+#if !defined(MSWIN)
# include <dlfcn.h>
# define HINSTANCE void*
# define RUBY_PROC void*
# endif
# define ruby_init dll_ruby_init
# define ruby_init_loadpath dll_ruby_init_loadpath
-# ifdef WIN3264
+# ifdef MSWIN
# ifdef RUBY19_OR_LATER
# define ruby_sysinit dll_ruby_sysinit
# else
# endif
static void (*dll_ruby_init) (void);
static void (*dll_ruby_init_loadpath) (void);
-# ifdef WIN3264
+# ifdef MSWIN
# ifdef RUBY19_OR_LATER
static void (*dll_ruby_sysinit) (int*, char***);
# else
# endif
{"ruby_init", (RUBY_PROC*)&dll_ruby_init},
{"ruby_init_loadpath", (RUBY_PROC*)&dll_ruby_init_loadpath},
-# ifdef WIN3264
+# ifdef MSWIN
# ifdef RUBY19_OR_LATER
{"ruby_sysinit", (RUBY_PROC*)&dll_ruby_sysinit},
# else
if (ruby_enabled(TRUE))
{
#endif
-#ifdef _WIN32
+#ifdef MSWIN
/* suggested by Ariya Mizutani */
int argc = 1;
char *argv[] = {"gvim.exe"};
typedef int HANDLE;
# endif
-# ifndef WIN3264
+# ifndef MSWIN
# include <dlfcn.h>
# define HANDLE void*
# define TCL_PROC void*
#endif
Tcl_SetChannelOption(interp, ch1, "-buffering", "line");
-#ifdef WIN3264
+#ifdef MSWIN
Tcl_SetChannelOption(interp, ch1, "-translation", "lf");
#endif
Tcl_SetChannelOption(interp, ch2, "-buffering", "line");
-#ifdef WIN3264
+#ifdef MSWIN
Tcl_SetChannelOption(interp, ch2, "-translation", "lf");
#endif
# define mch_stat(n, p) stat(vms_fixfilename(n), (p))
# define mch_rmdir(n) rmdir(vms_fixfilename(n))
#else
-# ifndef WIN32
+# ifndef MSWIN
# define mch_access(n, p) access((n), (p))
# endif
# define mch_fstat(n, p) fstat((n), (p))
-# ifdef MSWIN /* has its own mch_stat() function */
+# ifdef MSWIN // has its own mch_stat() function
# define mch_stat(n, p) vim_stat((n), (p))
# else
# ifdef STAT_IGNORES_SLASH
#if defined(UNIX) || defined(VMS) /* open in rw------- mode */
# define mch_open_rw(n, f) mch_open((n), (f), (mode_t)0600)
#else
-# if defined(MSWIN) /* open read/write */
+# if defined(MSWIN) // open read/write
# define mch_open_rw(n, f) mch_open((n), (f), S_IREAD | S_IWRITE)
# else
# define mch_open_rw(n, f) mch_open((n), (f), 0)
# include <math.h>
# endif
# ifdef USING_FLOAT_STUFF
-# if defined(WIN32)
+# ifdef MSWIN
# ifndef isnan
# define isnan(x) _isnan(x)
static __inline int isinf(double x) { return !_finite(x) && !_isnan(x); }
#include "vim.h"
#ifdef __CYGWIN__
-# ifndef WIN32
+# ifndef MSWIN
# include <cygwin/version.h>
# include <sys/cygwin.h> /* for cygwin_conv_to_posix_path() and/or
* cygwin_conv_path() */
# include <limits.h>
#endif
-#if defined(WIN3264) && !defined(FEAT_GUI_W32)
+#if defined(MSWIN) && !defined(FEAT_GUI_MSWIN)
# include "iscygpty.h"
#endif
*/
mch_early_init();
-#if defined(WIN32)
+#ifdef MSWIN
/*
* MinGW expands command line arguments, which confuses our code to
* convert when 'encoding' changes. Get the unexpanded arguments.
params.fname = alist_name(&GARGLIST[0]);
}
-#if defined(WIN32)
+#ifdef MSWIN
{
extern void set_alist_count(void);
}
#endif
-#if defined(WIN3264) && !defined(FEAT_GUI_W32)
+#if defined(MSWIN) && !defined(FEAT_GUI_MSWIN)
mch_set_winsize_now(); /* Allow winsize changes from now on */
#endif
{
# ifdef FEAT_GUI
# if !defined(FEAT_GUI_X11) && !defined(FEAT_GUI_GTK) \
- && !defined(FEAT_GUI_W32)
+ && !defined(FEAT_GUI_MSWIN)
if (gui.in_use)
{
mch_errmsg(_("netbeans is not supported with this GUI\n"));
if (garbage_collect_at_exit)
garbage_collect(FALSE);
#endif
-#if defined(WIN32)
+#ifdef MSWIN
free_cmd_argsW();
#endif
setlocale(LC_NUMERIC, "C");
# endif
-# ifdef WIN32
+# ifdef MSWIN
/* Apparently MS-Windows printf() may cause a crash when we give it 8-bit
* text while it's expecting text in the current locale. This call avoids
* that. */
}
# endif
-# if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_W32)
-# ifdef FEAT_GUI_W32
+# if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_MSWIN)
+# ifdef FEAT_GUI_MSWIN
else if (STRICMP(argv[i], "--windowid") == 0)
# else
else if (STRICMP(argv[i], "--socketid") == 0)
if (count != 1)
mainerr(ME_INVALID_ARG, (char_u *)argv[i]);
else
-# ifdef FEAT_GUI_W32
+# ifdef FEAT_GUI_MSWIN
win_socket_id = id;
# else
gtk_socket_id = id;
}
}
#endif
-#if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_W32)
+#if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_MSWIN)
# ifdef FEAT_GUI_GTK
else if (STRNICMP(argv[0] + argv_idx, "socketid", 8) == 0)
# else
case 'u': /* "-u {vimrc}" vim inits file */
case 'U': /* "-U {gvimrc}" gvim inits file */
case 'W': /* "-W {scriptout}" overwrite */
-#ifdef FEAT_GUI_W32
+#ifdef FEAT_GUI_MSWIN
case 'P': /* "-P {parent title}" MDI parent */
#endif
want_argument = TRUE;
}
break;
-#ifdef FEAT_GUI_W32
+#ifdef FEAT_GUI_MSWIN
case 'P': /* "-P {parent title}" MDI parent */
gui_mch_set_parent(argv[0]);
break;
}
}
#endif
-#if defined(__CYGWIN32__) && !defined(WIN32)
+#if defined(__CYGWIN32__) && !defined(MSWIN)
/*
* If vim is invoked by non-Cygwin tools, convert away any
* DOS paths, so things like .swp files are created correctly.
#endif
);
-#if defined(WIN32)
+#ifdef MSWIN
{
/* Remember this argument has been added to the argument list.
* Needed when 'encoding' is changed. */
exit(1);
}
#endif
-#if defined(WIN3264) && !defined(FEAT_GUI_W32)
+#if defined(MSWIN) && !defined(FEAT_GUI_MSWIN)
if (is_cygpty_used())
{
# if defined(HAVE_BIND_TEXTDOMAIN_CODESET) \
main_msg(_("--socketid <xid>\tOpen Vim inside another GTK widget"));
main_msg(_("--echo-wid\t\tMake gvim echo the Window ID on stdout"));
#endif
-#ifdef FEAT_GUI_W32
+#ifdef FEAT_GUI_MSWIN
main_msg(_("-P <parent title>\tOpen Vim inside parent application"));
main_msg(_("--windowid <HWND>\tOpen Vim inside another win32 widget"));
#endif
#if defined(STARTUPTIME) || defined(PROTO)
static struct timeval prev_timeval;
-# ifdef WIN3264
+# ifdef MSWIN
/*
* Windows doesn't have gettimeofday(), although it does have struct timeval.
*/
{
char_u *val = argv0;
-# if defined(WIN32)
+# ifdef MSWIN
/* A relative path containing a "/" will become invalid when using ":cd",
* turn it into a full path.
* On MS-Windows "vim" should be expanded to "vim.exe", thus always do
set_vim_var_string(VV_PROGPATH, val, -1);
-# ifdef WIN32
+# ifdef MSWIN
vim_free(path);
# endif
}
{
if (parmp->serverName_arg == NULL || *parmp->serverName_arg != NUL)
{
-# ifdef WIN32
+# ifdef MSWIN
/* Initialise the client/server messaging infrastructure. */
serverInitMessaging();
# endif
* clipboard first, it's further down. */
parmp->servername = serverMakeName(parmp->serverName_arg,
parmp->argv[0]);
-# ifdef WIN32
+# ifdef MSWIN
if (parmp->servername != NULL)
{
serverSetName(parmp->servername);
break;
}
-# ifdef FEAT_GUI_W32
+# ifdef FEAT_GUI_MSWIN
/* Guess that when the server name starts with "g" it's a GUI
* server, which we can bring to the foreground here.
* Foreground() in the server doesn't work very well. */
int j;
char_u *done = alloc(numFiles);
char_u *p;
-# ifdef FEAT_GUI_W32
+# ifdef FEAT_GUI_MSWIN
NOTIFYICONDATA ni;
int count = 0;
extern HWND message_window;
/* Skip "+cmd" argument, don't wait for it to be edited. */
--numFiles;
-# ifdef FEAT_GUI_W32
+# ifdef FEAT_GUI_MSWIN
ni.cbSize = sizeof(ni);
ni.hWnd = message_window;
ni.uID = 0;
vim_memset(done, 0, numFiles);
while (memchr(done, 0, numFiles) != NULL)
{
-# ifdef WIN32
+# ifdef MSWIN
p = serverGetReply(srv, NULL, TRUE, TRUE, 0);
if (p == NULL)
break;
j = atoi((char *)p);
if (j >= 0 && j < numFiles)
{
-# ifdef FEAT_GUI_W32
+# ifdef FEAT_GUI_MSWIN
++count;
sprintf(ni.szTip, _("%d of %d edited"),
count, numFiles);
done[j] = 1;
}
}
-# ifdef FEAT_GUI_W32
+# ifdef FEAT_GUI_MSWIN
Shell_NotifyIcon(NIM_DELETE, &ni);
# endif
}
{
if (i == *argc - 1)
mainerr_arg_missing((char_u *)argv[i]);
-# ifdef WIN32
+# ifdef MSWIN
/* Win32 always works? */
if (serverSendToVim(sname, (char_u *)argv[i + 1],
&res, NULL, 1, 0, FALSE) < 0)
}
else if (STRICMP(argv[i], "--serverlist") == 0)
{
-# ifdef WIN32
+# ifdef MSWIN
/* Win32 always works? */
res = serverGetVimNames();
# else
# define WINBYTE BYTE
#endif
-#if (defined(WIN3264) || defined(WIN32UNIX)) && !defined(__MINGW32__)
+#if (defined(MSWIN) || defined(WIN32UNIX)) && !defined(__MINGW32__)
# include <winnls.h>
#endif
# else
# include <gdk/gdkkeysyms.h>
# endif
-# ifdef WIN3264
+# ifdef MSWIN
# include <gdk/gdkwin32.h>
# else
# include <gdk/gdkx.h>
{"cyrillic", IDX_ISO_5},
{"arabic", IDX_ISO_6},
{"greek", IDX_ISO_7},
-#ifdef WIN3264
+#ifdef MSWIN
{"hebrew", IDX_CP1255},
#else
{"hebrew", IDX_ISO_8},
{"euccn", IDX_EUC_CN},
{"gb2312", IDX_EUC_CN},
{"euctw", IDX_EUC_TW},
-#if defined(WIN3264) || defined(WIN32UNIX) || defined(MACOS_X)
+#if defined(MSWIN) || defined(WIN32UNIX) || defined(MACOS_X)
{"japan", IDX_CP932},
{"korea", IDX_CP949},
{"prc", IDX_CP936},
i = enc_canon_search(name);
if (i >= 0)
return enc_canon_table[i].prop;
-#ifdef WIN3264
+#ifdef MSWIN
if (name[0] == 'c' && name[1] == 'p' && VIM_ISDIGIT(name[2]))
{
CPINFO cpinfo;
int idx;
int n;
int enc_dbcs_new = 0;
-#if defined(USE_ICONV) && !defined(WIN3264) && !defined(WIN32UNIX) \
+#if defined(USE_ICONV) && !defined(MSWIN) && !defined(WIN32UNIX) \
&& !defined(MACOS_CONVERT)
# define LEN_FROM_CONV
vimconv_T vimconv;
return NULL;
}
-#ifdef WIN3264
+#ifdef MSWIN
if (p_enc[0] == 'c' && p_enc[1] == 'p' && VIM_ISDIGIT(p_enc[2]))
{
CPINFO cpinfo;
}
else if (STRNCMP(p_enc, "2byte-", 6) == 0)
{
-#ifdef WIN3264
+#ifdef MSWIN
/* Windows: accept only valid codepage numbers, check below. */
if (p_enc[6] != 'c' || p_enc[7] != 'p'
|| (enc_dbcs_new = atoi((char *)p_enc + 8)) == 0)
if (enc_dbcs_new != 0)
{
-#ifdef WIN3264
+#ifdef MSWIN
/* Check if the DBCS code page is OK. */
if (!IsValidCodePage(enc_dbcs_new))
goto codepage_invalid;
enc_dbcs = enc_dbcs_new;
has_mbyte = (enc_dbcs != 0 || enc_utf8);
-#if defined(WIN3264) || defined(FEAT_CYGWIN_WIN32_CLIPBOARD)
+#if defined(MSWIN) || defined(FEAT_CYGWIN_WIN32_CLIPBOARD)
enc_codepage = encname2codepage(p_enc);
enc_latin9 = (STRCMP(p_enc, "iso-8859-15") == 0);
#endif
n = 1;
else
{
-#if defined(WIN3264) || defined(WIN32UNIX)
+#if defined(MSWIN) || defined(WIN32UNIX)
/* enc_dbcs is set by setting 'fileencoding'. It becomes a Windows
* CodePage identifier, which we can pass directly in to Windows
* API */
enc_utf8 ? "utf-8" : (char *)p_enc);
#endif
-#ifdef WIN32
+#ifdef MSWIN
/* When changing 'encoding' while starting up, then convert the command
* line arguments from the active codepage to 'encoding'. */
if (starting != 0)
unsigned char tb = trail;
/* convert process code to JIS */
-# if defined(WIN3264) || defined(WIN32UNIX) || defined(MACOS_X)
+# if defined(MSWIN) || defined(WIN32UNIX) || defined(MACOS_X)
/* process code is SJIS */
if (lb <= 0x9f)
lb = (lb - 0x81) * 2 + 0x21;
if (c1 >= 0xB0 && c1 <= 0xC8)
/* Hangul */
return 20;
-#if defined(WIN3264) || defined(WIN32UNIX)
+#if defined(MSWIN) || defined(WIN32UNIX)
else if (c1 <= 0xA0 || c2 <= 0xA0)
/* Extended Hangul Region : MS UHC(Unified Hangul Code) */
/* c1: 0x81-0xA0 with c2: 0x41-0x5A, 0x61-0x7A, 0x81-0xFE
# include <langinfo.h>
#endif
-#ifndef FEAT_GUI_W32
+#ifndef FEAT_GUI_MSWIN
/*
* Get the canonicalized encoding from the specified locale string "locale"
* or from the environment variables LC_ALL, LC_CTYPE and LANG.
char_u *
enc_locale(void)
{
-#ifdef WIN3264
+#ifdef MSWIN
char buf[50];
long acp = GetACP();
#endif
}
-# if defined(WIN3264) || defined(PROTO) || defined(FEAT_CYGWIN_WIN32_CLIPBOARD)
+# if defined(MSWIN) || defined(PROTO) || defined(FEAT_CYGWIN_WIN32_CLIPBOARD)
/*
* Convert an encoding name to an MS-Windows codepage.
* Returns zero if no codepage can be figured out.
/* Internal utf-8 -> latin9 conversion. */
vcp->vc_type = CONV_TO_LATIN9;
}
-#ifdef WIN3264
+#ifdef MSWIN
/* Win32-specific codepage <-> codepage conversion without iconv. */
else if ((from_is_utf8 || encname2codepage(from) > 0)
&& (to_is_utf8 || encname2codepage(to) > 0))
return OK;
}
-#if defined(FEAT_GUI) || defined(AMIGA) || defined(WIN3264) \
+#if defined(FEAT_GUI) || defined(AMIGA) || defined(MSWIN) \
|| defined(PROTO)
/*
* Do conversion on typed input characters in-place.
retval = iconv_string(vcp, ptr, len, unconvlenp, lenp);
break;
# endif
-# ifdef WIN3264
+# ifdef MSWIN
case CONV_CODEPAGE: /* codepage -> codepage */
{
int retlen;
status = FAIL;
}
#endif
-#ifdef WIN32
+#ifdef MSWIN
if (_commit(mfp->mf_fd))
status = FAIL;
#endif
* try to open the file
*/
flags |= O_EXTRA | O_NOFOLLOW;
-#ifdef WIN32
+#ifdef MSWIN
/* Prevent handle inheritance that cause problems with Cscope
* (swap file may not be deleted if cscope connection was open after
* the file) */
#else
names[0] = vim_strsave((char_u *)"*.sw?");
#endif
-#if defined(UNIX) || defined(WIN3264)
+#if defined(UNIX) || defined(MSWIN)
/* For Unix names starting with a dot are special. MS-Windows
* supports this too, on some file systems. */
names[1] = vim_strsave((char_u *)".*.sw?");
#else
names[0] = concat_fnames(dir_name, (char_u *)"*.sw?", TRUE);
#endif
-#if defined(UNIX) || defined(WIN3264)
+#if defined(UNIX) || defined(MSWIN)
/* For Unix names starting with a dot are special. MS-Windows
* supports this too, on some file systems. */
names[1] = concat_fnames(dir_name, (char_u *)".*.sw?", TRUE);
}
else
{
-#if defined(UNIX) || defined(WIN3264)
+#if defined(UNIX) || defined(MSWIN)
int len = (int)STRLEN(dir_name);
p = dir_name + len;
return file_count;
}
-#if defined(UNIX) || defined(WIN3264) || defined(PROTO)
+#if defined(UNIX) || defined(MSWIN) || defined(PROTO)
/*
* Need _very_ long file names.
* Append the full path to name with path separators made into percent
*/
char_u *p;
int i;
-# ifndef WIN3264
+# ifndef MSWIN
int shortname = curbuf->b_shortname;
curbuf->b_shortname = FALSE;
else
++num_names;
-# ifndef WIN3264
+# ifndef MSWIN
/*
* Also try with 'shortname' set, in case the file is on a DOS filesystem.
*/
# endif
end:
-# ifndef WIN3264
+# ifndef MSWIN
curbuf->b_shortname = shortname;
# endif
char_u fname_buf[MAXPATHL];
#endif
-#if defined(UNIX) || defined(WIN3264) /* Need _very_ long file names */
+#if defined(UNIX) || defined(MSWIN) // Need _very_ long file names
int len = (int)STRLEN(dir_name);
s = dir_name + len;
else
retval = concat_fnames(dname, tail, TRUE);
-#ifdef WIN3264
+#ifdef MSWIN
if (retval != NULL)
for (t = gettail(retval); *t != NUL; MB_PTR_ADV(t))
if (*t == ':')
# define CREATE_DUMMY_FILE
FILE *dummyfd = NULL;
-# ifdef WIN3264
+# ifdef MSWIN
if (buf_fname != NULL && !mch_isFullName(buf_fname)
&& vim_strchr(gettail(buf_fname), ':'))
{
mch_remove(buf_fname);
}
#endif
-#ifdef WIN3264
+#ifdef MSWIN
if (buf_fname != buf->b_fname)
vim_free(buf_fname);
#endif
#define MENUDEPTH 10 /* maximum depth of menus */
-#ifdef FEAT_GUI_W32
+#ifdef FEAT_GUI_MSWIN
static int add_menu_path(char_u *, vimmenu_T *, int *, char_u *, int);
#else
static int add_menu_path(char_u *, vimmenu_T *, int *, char_u *);
static char_u *popup_mode_name(char_u *name, int idx);
static char_u *menu_text(char_u *text, int *mnemonic, char_u **actext);
-#if defined(FEAT_GUI_W32) && defined(FEAT_TEAROFF)
+#if defined(FEAT_GUI_MSWIN) && defined(FEAT_TEAROFF)
static void gui_create_tearoffs_recurse(vimmenu_T *menu, const char_u *pname, int *pri_tab, int pri_idx);
static void gui_add_tearoff(char_u *tearpath, int *pri_tab, int pri_idx);
static void gui_destroy_tearoffs_recurse(vimmenu_T *menu);
#endif
static int menu_is_hidden(char_u *name);
-#if defined(FEAT_CMDL_COMPL) || (defined(FEAT_GUI_W32) && defined(FEAT_TEAROFF))
+#if defined(FEAT_CMDL_COMPL) || (defined(FEAT_GUI_MSWIN) && defined(FEAT_TEAROFF))
static int menu_is_tearoff(char_u *name);
#endif
int i;
#if defined(FEAT_GUI) && !defined(FEAT_GUI_GTK)
int old_menu_height;
-# if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_W32)
+# if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_MSWIN)
int old_toolbar_height;
# endif
#endif
}
#if defined(FEAT_GUI) && !(defined(FEAT_GUI_GTK) || defined(FEAT_GUI_PHOTON))
old_menu_height = gui.menu_height;
-# if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_W32)
+# if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_MSWIN)
old_toolbar_height = gui.toolbar_height;
# endif
#endif
menuarg.noremap[0] = noremap;
menuarg.silent[0] = silent;
add_menu_path(menu_path, &menuarg, pri_tab, map_to
-#ifdef FEAT_GUI_W32
+#ifdef FEAT_GUI_MSWIN
, TRUE
#endif
);
menuarg.icon_builtin = FALSE;
#endif
add_menu_path(p, &menuarg, pri_tab, map_to
-#ifdef FEAT_GUI_W32
+#ifdef FEAT_GUI_MSWIN
, TRUE
#endif
);
/* If the menubar height changed, resize the window */
if (gui.in_use
&& (gui.menu_height != old_menu_height
-# if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_W32)
+# if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_MSWIN)
|| gui.toolbar_height != old_toolbar_height
# endif
))
icon_builtin, silent[0], noremap[0] */
int *pri_tab,
char_u *call_data
-#ifdef FEAT_GUI_W32
+#ifdef FEAT_GUI_MSWIN
, int addtearoff /* may add tearoff item */
#endif
)
goto erret;
}
if (*next_name != NUL && menu->children == NULL
-#ifdef FEAT_GUI_W32
+#ifdef FEAT_GUI_MSWIN
&& addtearoff
#endif
)
if (*next_name == NUL && menuarg->iconfile != NULL)
menu->iconfile = vim_strsave(menuarg->iconfile);
#endif
-#if defined(FEAT_GUI_W32) && defined(FEAT_TEAROFF)
+#if defined(FEAT_GUI_MSWIN) && defined(FEAT_TEAROFF)
/* the tearoff item must be present in the modes of each item. */
if (parent != NULL && menu_is_tearoff(parent->children->dname))
parent->children->modes |= modes;
* modes, then make sure it's available for this one now
* Also enable a menu when it's created or changed.
*/
-#ifdef FEAT_GUI_W32
+#ifdef FEAT_GUI_MSWIN
/* If adding a tearbar (addtearoff == FALSE) don't update modes */
if (addtearoff)
#endif
}
}
-# if defined(FEAT_GUI_W32) & defined(FEAT_TEAROFF)
+# if defined(FEAT_GUI_MSWIN) & defined(FEAT_TEAROFF)
/* When adding a new submenu, may add a tearoff item */
if ( addtearoff
&& *next_name
c = 0;
d = 0;
if (amenu && call_data != NULL && *call_data != NUL
-#ifdef FEAT_GUI_W32
+#ifdef FEAT_GUI_MSWIN
&& addtearoff
#endif
)
menu->silent[i] = menuarg->silent[0];
}
}
-#if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_W32) \
+#if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_MSWIN) \
&& (defined(FEAT_BEVAL_GUI) || defined(FEAT_GUI_GTK))
/* Need to update the menu tip. */
if (modes & MENU_TIP_MODE)
}
if ((menu->modes & modes) != 0x0)
{
-#if defined(FEAT_GUI_W32) & defined(FEAT_TEAROFF)
+#if defined(FEAT_GUI_MSWIN) & defined(FEAT_TEAROFF)
/*
* If we are removing all entries for this menu,MENU_ALL_MODES,
* Then kill any tearoff before we start
/* Recalculate modes for menu based on the new updated children */
menu->modes &= ~modes;
-#if defined(FEAT_GUI_W32) & defined(FEAT_TEAROFF)
+#if defined(FEAT_GUI_MSWIN) & defined(FEAT_TEAROFF)
if ((s_tearoffs) && (menu->children != NULL)) /* there's a tear bar.. */
child = menu->children->next; /* don't count tearoff bar */
else
if (modes & MENU_TIP_MODE)
{
free_menu_string(menu, MENU_INDEX_TIP);
-#if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_W32) \
+#if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_MSWIN) \
&& (defined(FEAT_BEVAL_GUI) || defined(FEAT_GUI_GTK))
/* Need to update the menu tip. */
if (gui.in_use)
if ((menu->modes & MENU_ALL_MODES) == 0)
{
/* The menu item is no longer valid in ANY mode, so delete it */
-#if defined(FEAT_GUI_W32) & defined(FEAT_TEAROFF)
+#if defined(FEAT_GUI_MSWIN) & defined(FEAT_TEAROFF)
if (s_tearoffs && menu->children != NULL) /* there's a tear bar.. */
free_menu(&menu->children);
#endif
}
#if defined(FEAT_CMDL_COMPL) \
- || (defined(FEAT_GUI_W32) && defined(FEAT_TEAROFF))
+ || (defined(FEAT_GUI_MSWIN) && defined(FEAT_TEAROFF))
/*
* Return TRUE if the menu is the tearoff menu.
*/
while (menu)
{
if ((menu->modes & menu->enabled & mode)
-# if defined(FEAT_GUI_W32) && defined(FEAT_TEAROFF)
+# if defined(FEAT_GUI_MSWIN) && defined(FEAT_TEAROFF)
|| menu_is_tearoff(menu->dname)
# endif
)
# endif
#endif /* FEAT_GUI */
-#if (defined(FEAT_GUI_W32) && defined(FEAT_TEAROFF)) || defined(PROTO)
+#if (defined(FEAT_GUI_MSWIN) && defined(FEAT_TEAROFF)) || defined(PROTO)
/*
* Deal with tearoff items that are added like a menu item.
}
}
-#endif /* FEAT_GUI_W32 && FEAT_TEAROFF */
+#endif /* FEAT_GUI_MSWIN && FEAT_TEAROFF */
/*
* Execute "menu". Use by ":emenu" and the window toolbar.
msg_use_printf(void)
{
return (!msg_check_screen()
-#if defined(WIN3264) && !defined(FEAT_GUI_MSWIN)
+#if defined(MSWIN) && !defined(FEAT_GUI_MSWIN)
|| !termcap_active
#endif
|| (swapping_screen() && !termcap_active)
char_u *buf = NULL;
char_u *p = s;
-#ifdef WIN3264
+#ifdef MSWIN
if (!(silent_mode && p_verbose == 0))
mch_settmode(TMODE_COOK); /* handle CR and NL correctly */
#endif
msg_didout = TRUE; // assume that line is not empty
-#ifdef WIN3264
+#ifdef MSWIN
if (!(silent_mode && p_verbose == 0))
mch_settmode(TMODE_RAW);
#endif
void
mch_errmsg(char *str)
{
-#if defined(WIN3264) && !defined(FEAT_GUI_MSWIN)
+#if defined(MSWIN) && !defined(FEAT_GUI_MSWIN)
int len = (int)STRLEN(str);
DWORD nwrite = 0;
DWORD mode = 0;
void
mch_msg(char *str)
{
-#if defined(WIN3264) && !defined(FEAT_GUI_MSWIN)
+#if defined(MSWIN) && !defined(FEAT_GUI_MSWIN)
int len = (int)STRLEN(str);
DWORD nwrite = 0;
DWORD mode;
filter = BROWSE_FILTER_DEFAULT;
if (flags & BROWSE_DIR)
{
-# if defined(FEAT_GUI_GTK) || defined(WIN3264)
+# if defined(FEAT_GUI_GTK) || defined(MSWIN)
/* For systems that have a directory dialog. */
fname = gui_mch_browsedir(title, initdir);
# else
else if (length_modifier == 'L')
{
# ifdef FEAT_NUM64
-# ifdef WIN3264
+# ifdef MSWIN
f[f_l++] = 'I';
f[f_l++] = '6';
f[f_l++] = '4';
#include "vim.h"
#include "version.h"
-#if defined(FEAT_CMDL_COMPL) && defined(WIN3264)
+#if defined(FEAT_CMDL_COMPL) && defined(MSWIN)
# include <lm.h>
#endif
var = mch_getenv((char_u *)"HOME");
#endif
-#ifdef WIN3264
+#ifdef MSWIN
/*
* Typically, $HOME is not defined on Windows, unless the user has
* specifically defined it for Vim's sake. However, on Windows NT
if (p != NULL)
{
-#if defined(WIN3264)
+#if defined(MSWIN)
if (enc_utf8)
{
int len;
else
p = mch_getenv((char_u *)"VIM");
-#if defined(WIN3264)
+#if defined(MSWIN)
if (enc_utf8)
{
int len;
add_user((char_u *)pw->pw_name, TRUE);
endpwent();
}
-# elif defined(WIN3264)
+# elif defined(MSWIN)
{
DWORD nusers = 0, ntotal = 0, i;
PUSER_INFO_0 uinfo;
#else
homedir_env_orig = homedir_env = mch_getenv((char_u *)"HOME");
#endif
-#ifdef WIN3264
+#ifdef MSWIN
if (homedir_env == NULL)
homedir_env_orig = homedir_env = mch_getenv((char_u *)"USERPROFILE");
#endif
static int expand_backtick(garray_T *gap, char_u *pat, int flags);
# endif
-# if defined(WIN3264)
+# if defined(MSWIN)
/*
* File name expansion code for MS-DOS, Win16 and Win32. It's here because
* it's shared between these systems.
{
return dos_expandpath(gap, path, 0, flags, FALSE);
}
-# endif /* WIN3264 */
+# endif // MSWIN
#if (defined(UNIX) && !defined(VMS)) || defined(USE_UNIXFILENAME) \
|| defined(PROTO)
{
char_u *p;
-#ifdef WIN3264
+#ifdef MSWIN
p = gettail(p_sh);
p = vim_strnsave(p, (int)(skiptowhite(p) - p));
#else
length = (unsigned)STRLEN(string) + 3; /* two quotes and a trailing NUL */
for (p = string; *p != NUL; MB_PTR_ADV(p))
{
-# ifdef WIN32
+# ifdef MSWIN
if (!p_ssl)
{
if (*p == '"')
d = escaped_string;
/* add opening quote */
-# ifdef WIN32
+# ifdef MSWIN
if (!p_ssl)
*d++ = '"';
else
for (p = string; *p != NUL; )
{
-# ifdef WIN32
+# ifdef MSWIN
if (!p_ssl)
{
if (*p == '"')
}
/* add terminating quote and finish with a NUL */
-# ifdef WIN32
+# ifdef MSWIN
if (!p_ssl)
*d++ = '"';
else
}
}
-#if (defined(UNIX) && !defined(USE_SYSTEM)) || defined(WIN3264) \
+#if (defined(UNIX) && !defined(USE_SYSTEM)) || defined(MSWIN) \
|| defined(PROTO)
/*
* Append the text in "gap" below the cursor line and clear "gap".
perm = mch_getperm(fname);
#endif
if (
-# ifdef WIN3264
+# ifdef MSWIN
mch_writable(fname) &&
# else
# if defined(UNIX) || defined(VMS)
for (i = 0; i < MAX_REPEAT_PARSE; ++i)
{
// For Win32 mch_breakcheck() does not check for input, do it here.
-# if defined(WIN32) && defined(FEAT_JOB_CHANNEL)
+# if defined(MSWIN) && defined(FEAT_JOB_CHANNEL)
channel_handle_events(FALSE);
# endif
expand_env((char_u *) file, (char_u *) buf, BUFSIZ);
return
-#ifndef FEAT_GUI_W32
+#ifndef FEAT_GUI_MSWIN
(access(buf, F_OK) == 0);
#else
(access(buf, 0) == 0);
#if defined(FEAT_NETBEANS_INTG) || defined(PROTO)
-#ifndef WIN32
+#ifndef MSWIN
# include <netdb.h>
# ifdef HAVE_LIBGEN_H
# include <libgen.h>
{
#ifdef FEAT_GUI
# if !defined(FEAT_GUI_X11) && !defined(FEAT_GUI_GTK) \
- && !defined(FEAT_GUI_W32)
+ && !defined(FEAT_GUI_MSWIN)
if (gui.in_use)
{
emsg(_("E838: netbeans is not supported with this GUI"));
}
#endif
-#if defined(FEAT_GUI_X11) || defined(FEAT_GUI_W32) || defined(PROTO)
+#if defined(FEAT_GUI_X11) || defined(FEAT_GUI_MSWIN) || defined(PROTO)
/*
* Tell netbeans that the window was moved or resized.
*/
# endif
#endif
redraw_later(CLEAR);
-#if defined(WIN3264) && !defined(FEAT_GUI_W32)
+#if defined(MSWIN) && !defined(FEAT_GUI_MSWIN)
resize_console_buf();
#endif
}
(char_u *)NULL, PV_NONE,
#endif
{
-#if (defined(WIN3264)) && !defined(FEAT_GUI_W32)
+#if defined(MSWIN) && !defined(FEAT_GUI_MSWIN)
(char_u *)128L,
#else
(char_u *)224L,
{"background", "bg", P_STRING|P_VI_DEF|P_RCLR,
(char_u *)&p_bg, PV_NONE,
{
-#if (defined(WIN3264)) && !defined(FEAT_GUI)
+#if (defined(MSWIN)) && !defined(FEAT_GUI)
(char_u *)"dark",
#else
(char_u *)"light",
#ifdef FEAT_QUICKFIX
(char_u *)&p_gp, PV_GP,
{
-# ifdef WIN3264
+# ifdef MSWIN
/* may be changed to "grep -n" in os_win32.c */
(char_u *)"findstr /n",
# else
{"lines", NULL, P_NUM|P_NODEFAULT|P_NO_MKRC|P_VI_DEF|P_RCLR,
(char_u *)&Rows, PV_NONE,
{
-#if defined(WIN3264)
+#if defined(MSWIN)
(char_u *)25L,
#else
(char_u *)24L,
#else
(char_u *)NULL, PV_NONE,
#endif
-#ifdef FEAT_GUI_W32
+#ifdef FEAT_GUI_MSWIN
{(char_u *)1L, (char_u *)0L}
#else
{(char_u *)0L, (char_u *)0L}
{"mouse", NULL, P_STRING|P_VI_DEF|P_FLAGLIST,
(char_u *)&p_mouse, PV_NONE,
{
-#if defined(WIN3264)
+#if defined(MSWIN)
(char_u *)"a",
#else
(char_u *)"",
(char_u *)&p_report, PV_NONE,
{(char_u *)2L, (char_u *)0L} SCTX_INIT},
{"restorescreen", "rs", P_BOOL|P_VI_DEF,
-#ifdef WIN3264
+#ifdef MSWIN
(char_u *)&p_rs, PV_NONE,
#else
(char_u *)NULL, PV_NONE,
#ifdef VMS
(char_u *)"-",
#else
-# if defined(WIN3264)
+# if defined(MSWIN)
(char_u *)"", /* set in set_init_1() */
# else
(char_u *)"sh",
{"shellxescape", "sxe", P_STRING|P_VI_DEF|P_SECURE,
(char_u *)&p_sxe, PV_NONE,
{
-#if defined(WIN3264)
+#if defined(MSWIN)
(char_u *)"\"&|<>()@^",
#else
(char_u *)"",
#endif
SCTX_INIT},
{"termwintype", "twt", P_STRING|P_ALLOCED|P_VI_DEF,
-#if defined(WIN3264) && defined(FEAT_TERMINAL)
+#if defined(MSWIN) && defined(FEAT_TERMINAL)
(char_u *)&p_twt, PV_NONE,
{(char_u *)"", (char_u *)NULL}
#else
#endif
{(char_u *)"", (char_u *)0L} SCTX_INIT},
{"toolbar", "tb", P_STRING|P_ONECOMMA|P_VI_DEF|P_NODUP,
-#if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_W32)
+#if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_MSWIN)
(char_u *)&p_toolbar, PV_NONE,
{(char_u *)"icons,tooltips", (char_u *)0L}
#else
{"undolevels", "ul", P_NUM|P_VI_DEF,
(char_u *)&p_ul, PV_UL,
{
-#if defined(UNIX) || defined(WIN3264) || defined(VMS)
+#if defined(UNIX) || defined(MSWIN) || defined(VMS)
(char_u *)1000L,
#else
(char_u *)100L,
(char_u *)&p_wmw, PV_NONE,
{(char_u *)1L, (char_u *)0L} SCTX_INIT},
{"winptydll", NULL, P_STRING|P_EXPAND|P_VI_DEF|P_SECURE,
-#if defined(WIN3264) && defined(FEAT_TERMINAL)
+#if defined(MSWIN) && defined(FEAT_TERMINAL)
(char_u *)&p_winptydll, PV_NONE, {
# ifdef _WIN64
(char_u *)"winpty64.dll",
#ifdef FEAT_SIGNS
static char *(p_scl_values[]) = {"yes", "no", "auto", NULL};
#endif
-#if defined(WIN3264) && defined(FEAT_TERMINAL)
+#if defined(MSWIN) && defined(FEAT_TERMINAL)
static char *(p_twt_values[]) = {"winpty", "conpty", "", NULL};
#endif
if (((p = mch_getenv((char_u *)"SHELL")) != NULL && *p != NUL)
#if defined(MSWIN)
|| ((p = mch_getenv((char_u *)"COMSPEC")) != NULL && *p != NUL)
-# ifdef WIN3264
+# ifdef MSWIN
|| ((p = (char_u *)default_shell()) != NULL && *p != NUL)
# endif
#endif
didset_options2();
-# if defined(WIN3264) && defined(FEAT_GETTEXT)
+# if defined(MSWIN) && defined(FEAT_GETTEXT)
/*
* If $LANG isn't set, try to get a good value for it. This makes the
* right language be used automatically. Don't do this for English.
}
#endif
-#if defined(WIN3264) && !defined(FEAT_GUI)
+#if defined(MSWIN) && !defined(FEAT_GUI)
/* Win32 console: When GetACP() returns a different value from
* GetConsoleCP() set 'termencoding'. */
if (GetACP() != GetConsoleCP())
p_tenc = empty_option;
}
#endif
-#if defined(WIN3264)
+#if defined(MSWIN)
/* $HOME may have characters in active code page. */
init_homedir();
#endif
set_number_default("window", Rows - 1);
/* For DOS console the default is always black. */
-#if !((defined(WIN3264)) && !defined(FEAT_GUI))
+#if !((defined(MSWIN)) && !defined(FEAT_GUI))
/*
* If 'background' wasn't set by the user, try guessing the value,
* depending on the terminal name. Only need to check for terminals
static char_u *
term_bg_default(void)
{
-#if defined(WIN3264)
+#if defined(MSWIN)
/* DOS console is nearly always black */
return (char_u *)"dark";
#else
void
set_init_3(void)
{
-#if defined(UNIX) || defined(WIN3264)
+#if defined(UNIX) || defined(MSWIN)
/*
* Set 'shellpipe' and 'shellredir', depending on the 'shell' option.
* This is done after other initializations, where 'shell' might have been
*/
if ( fnamecmp(p, "csh") == 0
|| fnamecmp(p, "tcsh") == 0
-# if defined(WIN3264) /* also check with .exe extension */
+# if defined(MSWIN) // also check with .exe extension
|| fnamecmp(p, "csh.exe") == 0
|| fnamecmp(p, "tcsh.exe") == 0
# endif
# if defined(FEAT_QUICKFIX)
if (do_sp)
{
-# ifdef WIN3264
+# ifdef MSWIN
p_sp = (char_u *)">&";
# else
p_sp = (char_u *)"|& tee";
|| fnamecmp(p, "zsh-beta") == 0
|| fnamecmp(p, "bash") == 0
|| fnamecmp(p, "fish") == 0
-# ifdef WIN3264
+# ifdef MSWIN
|| fnamecmp(p, "cmd") == 0
|| fnamecmp(p, "sh.exe") == 0
|| fnamecmp(p, "ksh.exe") == 0
# if defined(FEAT_QUICKFIX)
if (do_sp)
{
-# ifdef WIN3264
+# ifdef MSWIN
p_sp = (char_u *)">%s 2>&1";
# else
p_sp = (char_u *)"2>&1| tee";
}
#endif
-#if defined(WIN3264)
+#if defined(MSWIN)
/*
* Set 'shellcmdflag', 'shellxquote', and 'shellquote' depending on the
* 'shell' option.
(void)compile_cap_prog(curwin->w_s);
(void)did_set_spell_option(TRUE);
#endif
-#if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_W32)
+#if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_MSWIN)
(void)opt_strings_flags(p_toolbar, p_toolbar_values, &toolbar_flags, TRUE);
#endif
#if defined(FEAT_TOOLBAR) && defined(FEAT_GUI_GTK)
}
}
-#if defined(WIN3264)
+#if defined(MSWIN)
/* $HOME may have characters in active code page. */
if (varp == &p_enc)
init_homedir();
{
out_str(T_ME);
redraw_later(CLEAR);
-#if defined(WIN3264) && !defined(FEAT_GUI_W32)
+#if defined(MSWIN) && !defined(FEAT_GUI_MSWIN)
/* Since t_me has been set, this probably means that the user
* wants to use this as default colors. Need to reset default
* background/foreground colors. */
#endif
-#if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_W32)
+#if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_MSWIN)
/* 'toolbar' */
else if (varp == &p_toolbar)
{
errmsg = e_invarg;
}
}
-# if defined(WIN3264)
+# if defined(MSWIN)
// 'termwintype'
else if (varp == &p_twt)
{
#ifdef AMIGA
# define DFLT_EFM "%f>%l:%c:%t:%n:%m,%f:%l: %t%*\\D%n: %m,%f %l %t%*\\D%n: %m,%*[^\"]\"%f\"%*\\D%l: %m,%f:%l:%m,%f|%l| %m"
#else
-# if defined(WIN3264)
+# if defined(MSWIN)
# define DFLT_EFM "%f(%l) \\=: %t%*\\D%n: %m,%*[^\"]\"%f\"%*\\D%l: %m,%f(%l) \\=: %m,%*[^ ] %f %l: %m,%f:%l:%c:%m,%f(%l):%m,%f:%l:%m,%f|%l| %m"
# else
# if defined(__QNX__)
#ifdef FEAT_RIGHTLEFT
EXTERN int p_hkmap; /* 'hkmap' */
EXTERN int p_hkmapp; /* 'hkmapp' */
-# ifdef FEAT_FKMAP
-EXTERN int p_fkmap; /* 'fkmap' */
-EXTERN int p_altkeymap; /* 'altkeymap' */
-# endif
# ifdef FEAT_ARABIC
EXTERN int p_arshape; /* 'arabicshape' */
# endif
#if defined(FEAT_QUICKFIX)
EXTERN long p_pvh; /* 'previewheight' */
#endif
-#ifdef WIN3264
+#ifdef MSWIN
EXTERN int p_rs; /* 'restorescreen' */
#endif
#ifdef FEAT_RIGHTLEFT
#ifdef FEAT_TERMGUICOLORS
EXTERN int p_tgc; /* 'termguicolors' */
#endif
-#if defined(WIN3264) && defined(FEAT_TERMINAL)
+#if defined(MSWIN) && defined(FEAT_TERMINAL)
EXTERN char_u *p_twt; // 'termwintype'
#endif
EXTERN int p_terse; /* 'terse' */
EXTERN long p_ttm; /* 'ttimeoutlen' */
EXTERN int p_tbi; /* 'ttybuiltin' */
EXTERN int p_tf; /* 'ttyfast' */
-#if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_W32)
+#if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_MSWIN)
EXTERN char_u *p_toolbar; /* 'toolbar' */
EXTERN unsigned toolbar_flags;
# ifdef IN_OPTION_C
EXTERN long p_wmh; /* 'winminheight' */
EXTERN long p_wmw; /* 'winminwidth' */
EXTERN long p_wiw; /* 'winwidth' */
-#if defined(WIN3264) && defined(FEAT_TERMINAL)
+#if defined(MSWIN) && defined(FEAT_TERMINAL)
EXTERN char_u *p_winptydll; /* 'winptydll' */
#endif
EXTERN int p_ws; /* 'wrapscan' */
#endif
#ifndef PROTO
-# if defined(FEAT_TITLE) && !defined(FEAT_GUI_W32)
+# if defined(FEAT_TITLE) && !defined(FEAT_GUI_MSWIN)
# include <shellapi.h>
# endif
}
if (STRCMP(name, "*") == 0)
{
-#if defined(FEAT_GUI_W32)
+#if defined(FEAT_GUI_MSWIN)
CHOOSEFONT cf;
/* if name is "*", bring up std font dialog: */
vim_memset(&cf, 0, sizeof(cf));
#endif
#ifdef __CYGWIN__
-# ifndef WIN32
+# ifndef MSWIN
# include <cygwin/version.h>
# include <sys/cygwin.h> /* for cygwin_conv_to_posix_path() and/or
* for cygwin_conv_path() */
/* cproto doesn't create a prototype for main() */
int _cdecl
-#if defined(FEAT_GUI_W32)
+#if defined(FEAT_GUI_MSWIN)
VimMain
#else
main
pSaveInst = SaveInst;
# endif
pmain =
-# if defined(FEAT_GUI_W32)
+# if defined(FEAT_GUI_MSWIN)
//&& defined(__MINGW32__)
VimMain
# else
* os_win32.c
*
* Used for both the console version and the Win32 GUI. A lot of code is for
- * the console version only, so there is a lot of "#ifndef FEAT_GUI_W32".
+ * the console version only, so there is a lot of "#ifndef FEAT_GUI_MSWIN".
*
* Win32 (Windows NT and Windows 95) system-dependent routines.
* Portions lifted from the Win32 SDK samples, the MSDOS-dependent code,
#endif
#ifndef PROTO
-# if defined(FEAT_TITLE) && !defined(FEAT_GUI_W32)
+# if defined(FEAT_TITLE) && !defined(FEAT_GUI_MSWIN)
# include <shellapi.h>
# endif
#endif
# define wcsicmp(a, b) wcscmpi((a), (b))
#endif
-#ifndef FEAT_GUI_W32
+#ifndef FEAT_GUI_MSWIN
/* Win32 Console handles for input and output */
static HANDLE g_hConIn = INVALID_HANDLE_VALUE;
static HANDLE g_hConOut = INVALID_HANDLE_VALUE;
static int conpty_stable = 0;
static void vtp_flag_init();
-#ifndef FEAT_GUI_W32
+#ifndef FEAT_GUI_MSWIN
static int vtp_working = 0;
static void vtp_init();
static void vtp_exit();
# define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x0004
#endif
-#ifndef FEAT_GUI_W32
+#ifndef FEAT_GUI_MSWIN
static int suppress_winsize = 1; /* don't fiddle with console */
#endif
static BOOL win8_or_later = FALSE;
-#ifndef FEAT_GUI_W32
+#ifndef FEAT_GUI_MSWIN
/* Dynamic loading for portability */
typedef struct _DYN_CONSOLE_SCREEN_BUFFER_INFOEX
{
return ver;
}
-#ifndef FEAT_GUI_W32
+#ifndef FEAT_GUI_MSWIN
/*
* Version of ReadConsoleInput() that works with IME.
* Works around problems on Windows 8.
}
}
-#ifndef FEAT_GUI_W32
+#ifndef FEAT_GUI_MSWIN
#define SHIFT (SHIFT_PRESSED)
#define CTRL (RIGHT_CTRL_PRESSED | LEFT_CTRL_PRESSED)
# pragma optimize("", on)
#endif
-#endif /* FEAT_GUI_W32 */
+#endif /* FEAT_GUI_MSWIN */
#ifdef FEAT_MOUSE
/*
* For the GUI the mouse handling is in gui_w32.c.
*/
-# ifdef FEAT_GUI_W32
+# ifdef FEAT_GUI_MSWIN
void
mch_setmouse(int on UNUSED)
{
return TRUE;
}
-# endif /* FEAT_GUI_W32 */
+# endif /* FEAT_GUI_MSWIN */
#endif /* FEAT_MOUSE */
}
#endif
-#ifndef FEAT_GUI_W32 /* this isn't used for the GUI */
+#ifndef FEAT_GUI_MSWIN /* this isn't used for the GUI */
/*
* Handle FOCUS_EVENT.
*/
#endif
}
}
-#endif /* !FEAT_GUI_W32 */
+#endif /* !FEAT_GUI_MSWIN */
/*
long time UNUSED,
int tb_change_cnt UNUSED)
{
-#ifndef FEAT_GUI_W32 /* this isn't used for the GUI */
+#ifndef FEAT_GUI_MSWIN /* this isn't used for the GUI */
int len;
int c;
}
return len;
-#else /* FEAT_GUI_W32 */
+#else /* FEAT_GUI_MSWIN */
return 0;
-#endif /* FEAT_GUI_W32 */
+#endif /* FEAT_GUI_MSWIN */
}
#ifndef PROTO
# define SET_INVALID_PARAM_HANDLER
#endif
-#ifdef FEAT_GUI_W32
+#ifdef FEAT_GUI_MSWIN
/*
* GUI version of mch_init().
}
-#else /* FEAT_GUI_W32 */
+#else /* FEAT_GUI_MSWIN */
#define SRWIDTH(sr) ((sr).Right - (sr).Left + 1)
#define SRHEIGHT(sr) ((sr).Bottom - (sr).Top + 1)
exit(r);
}
-#endif /* !FEAT_GUI_W32 */
+#endif /* !FEAT_GUI_MSWIN */
/*
* Do we have an interactive window?
{
get_exe_name();
-#ifdef FEAT_GUI_W32
+#ifdef FEAT_GUI_MSWIN
return OK; /* GUI always has a tty */
#else
if (isatty(1))
#endif
}
-#ifndef FEAT_GUI_W32
+#ifndef FEAT_GUI_MSWIN
/*
* handler for ctrl-break, ctrl-c interrupts, and fatal events.
}
suppress_winsize = 0;
}
-#endif /* FEAT_GUI_W32 */
+#endif /* FEAT_GUI_MSWIN */
static BOOL
vim_create_process(
}
-#if defined(FEAT_GUI_W32) || defined(PROTO)
+#if defined(FEAT_GUI_MSWIN) || defined(PROTO)
/*
* Specialised version of system() for Win32 GUI mode.
else
{
x = -1;
-#ifdef FEAT_GUI_W32
+#ifdef FEAT_GUI_MSWIN
emsg(_("E371: Command not found"));
#endif
}
else
{
cmdlen = (
-#ifdef FEAT_GUI_W32
+#ifdef FEAT_GUI_MSWIN
(!p_stmp ? 0 : STRLEN(vimrun_path)) +
#endif
STRLEN(p_sh) + STRLEN(p_shcf) + STRLEN(cmd) + 10);
newcmd = lalloc(cmdlen, TRUE);
if (newcmd != NULL)
{
-#if defined(FEAT_GUI_W32)
+#if defined(FEAT_GUI_MSWIN)
if (need_vimrun_warning)
{
char *msg = _("VIMRUN.EXE not found in your $PATH.\n"
/* Print the return value, unless "vimrun" was used. */
if (x != 0 && !(options & SHELL_SILENT) && !emsg_silent
-#if defined(FEAT_GUI_W32)
+#if defined(FEAT_GUI_MSWIN)
&& ((options & SHELL_DOOUT) || s_dont_use_vimrun || !p_stmp)
#endif
)
#endif
-#ifndef FEAT_GUI_W32
+#ifndef FEAT_GUI_MSWIN
/*
* Start termcap mode
g_fTermcapMode = FALSE;
}
-#endif /* FEAT_GUI_W32 */
+#endif /* FEAT_GUI_MSWIN */
-#ifdef FEAT_GUI_W32
+#ifdef FEAT_GUI_MSWIN
void
mch_write(
char_u *s UNUSED,
#endif
}
-#endif /* FEAT_GUI_W32 */
+#endif /* FEAT_GUI_MSWIN */
/*
long msec,
int ignoreinput UNUSED)
{
-#ifdef FEAT_GUI_W32
+#ifdef FEAT_GUI_MSWIN
Sleep((int)msec); /* never wait for input */
#else /* Console */
if (ignoreinput)
void
mch_breakcheck(int force)
{
-#ifndef FEAT_GUI_W32 /* never used */
+#ifndef FEAT_GUI_MSWIN /* never used */
if (g_fCtrlCPressed || g_fCBrkPressed)
{
ctrl_break_was_pressed = g_fCBrkPressed;
vtp_flag_init(void)
{
DWORD ver = get_build_number();
-#ifndef FEAT_GUI_W32
+#ifndef FEAT_GUI_MSWIN
DWORD mode;
HANDLE out;
}
-#if !defined(FEAT_GUI_W32) || defined(PROTO)
+#if !defined(FEAT_GUI_MSWIN) || defined(PROTO)
static void
vtp_init(void)
return conpty_stable;
}
-#if !defined(FEAT_GUI_W32) || defined(PROTO)
+#if !defined(FEAT_GUI_MSWIN) || defined(PROTO)
void
resize_console_buf(void)
{
#if defined(__DATE__) && defined(__TIME__)
# define HAVE_DATE_TIME
#endif
-#ifndef FEAT_GUI_W32 /* GUI works different */
+#ifndef FEAT_GUI_MSWIN /* GUI works different */
# define BREAKCHECK_SKIP 1 /* call mch_breakcheck() each time, it's fast */
#endif
#define HAVE_PUTENV /* at least Bcc 5.2 and MSC have it */
-#ifdef FEAT_GUI_W32
+#ifdef FEAT_GUI_MSWIN
# define NO_CONSOLE /* don't included console-only code */
#endif
# if defined(UNIX) || defined(VMS)
# include "os_unix.pro"
# endif
-# ifdef WIN3264
+# ifdef MSWIN
# include "os_win32.pro"
# include "os_mswin.pro"
# include "winclip.pro"
extern char_u *vimpty_getenv(const char_u *string); /* in misc2.c */
# endif
# endif
-# ifdef FEAT_GUI_W32
+# ifdef FEAT_GUI_MSWIN
# include "gui_w32.pro"
# endif
# ifdef FEAT_GUI_GTK
screen_attr = attr;
if (full_screen
-#ifdef WIN3264
+#ifdef MSWIN
&& termcap_active
#endif
)
int do_ME = FALSE; /* output T_ME code */
if (screen_attr != 0
-#ifdef WIN3264
+#ifdef MSWIN
&& termcap_active
#endif
)
}
if (options & SEARCH_REV)
{
-#ifdef WIN32
+#ifdef MSWIN
/* There is a bug in the Visual C++ 2.2 compiler which means that
* dirc always ends up being '/' */
dirc = (dirc == '/') ? '?' : '/';
{
int vc_type; /* zero or one of the CONV_ values */
int vc_factor; /* max. expansion factor */
-# ifdef WIN3264
+# ifdef MSWIN
int vc_cpfrom; /* codepage to convert from (CONV_CODEPAGE) */
int vc_cpto; /* codepage to convert to (CONV_CODEPAGE) */
# endif
#define CONV_TO_LATIN1 3
#define CONV_TO_LATIN9 4
#define CONV_ICONV 5
-#ifdef WIN3264
+#ifdef MSWIN
# define CONV_CODEPAGE 10 /* codepage -> codepage */
#endif
#ifdef MACOS_X
#ifdef FEAT_NUM64
/* Use 64-bit Number. */
-# ifdef WIN3264
+# ifdef MSWIN
# ifdef PROTO
typedef long varnumber_T;
typedef unsigned long uvarnumber_T;
#ifdef UNIX
pid_t jv_pid;
#endif
-#ifdef WIN32
+#ifdef MSWIN
PROCESS_INFORMATION jv_proc_info;
HANDLE jv_job_object;
#endif
#ifdef UNIX
char_u *jv_termsig; /* allocated */
#endif
-#ifdef WIN3264
+#ifdef MSWIN
char_u *jv_tty_type; // allocated
#endif
int jv_exitval;
* message when the deadline was set. If it gets longer (something was
* received) the deadline is reset. */
size_t ch_wait_len;
-#ifdef WIN32
+#ifdef MSWIN
DWORD ch_deadline;
#else
struct timeval ch_deadline;
/* callback for Netbeans when channel is
* closed */
-#ifdef WIN32
+#ifdef MSWIN
int ch_named_pipe; /* using named pipe instead of pty */
#endif
char_u *ch_callback; /* call when any msg is not handled */
#ifdef FEAT_BEVAL_TIP
BalloonEval *tip; /* tooltip for this menu item */
#endif
-#ifdef FEAT_GUI_W32
+#ifdef FEAT_GUI_MSWIN
UINT id; /* Id of menu item */
HMENU submenu_id; /* If this is submenu, add children here */
HWND tearoff_handle; /* hWnd of tearoff if created */
void
restore_cterm_colors(void)
{
-#if defined(WIN3264) && !defined(FEAT_GUI_W32)
+#if defined(MSWIN) && !defined(FEAT_GUI_MSWIN)
/* Since t_me has been set, this probably means that the user
* wants to use this as default colors. Need to reset default
* background/foreground colors. */
at_en.ae_u.cterm.fg_color = sgp->sg_cterm_fg;
at_en.ae_u.cterm.bg_color = sgp->sg_cterm_bg;
# ifdef FEAT_TERMGUICOLORS
-# ifdef WIN3264
+# ifdef MSWIN
{
int id;
guicolor_T fg, bg;
}
#endif
-#if (defined(WIN3264) \
- && !defined(FEAT_GUI_W32) \
+#if (defined(MSWIN) \
+ && !defined(FEAT_GUI_MSWIN) \
&& defined(FEAT_TERMGUICOLORS)) || defined(PROTO)
void
syn_id2cterm_bg(int hl_id, int *fgp, int *bgp)
{K_PAGEUP, "\316I"},
# endif
-# if defined(WIN3264) || defined(ALL_BUILTIN_TCAPS)
+# if defined(MSWIN) || defined(ALL_BUILTIN_TCAPS)
/*
* These codes are valid for the Win32 Console . The entries that start with
* ESC | are translated into console calls in os_win32.c. The function keys
/* termcap failed to report size */
/* set defaults, in case ui_get_shellsize() also fails */
width = 80;
-#if defined(WIN3264)
+#if defined(MSWIN)
height = 25; /* console is often 25 lines */
#else
height = 24; /* most terminals are 24 lines */
return;
}
-#if defined(WIN3264) && !defined(FEAT_GUI)
+#if defined(MSWIN) && !defined(FEAT_GUI)
s = vim_strnsave(string, (int)STRLEN(string) + 1);
#else
s = vim_strsave(string);
s[0] = term_7to8bit(string);
}
-#if defined(WIN3264) && !defined(FEAT_GUI)
+#if defined(MSWIN) && !defined(FEAT_GUI)
if (s[0] == K_NUL)
{
STRMOVE(s + 1, s);
}
#endif
-#if (defined(WIN3264) && !defined(FEAT_GUI)) || defined(PROTO)
+#if (defined(MSWIN) && !defined(FEAT_GUI)) || defined(PROTO)
static char ksme_str[20];
static char ksmr_str[20];
static char ksmd_str[20];
/* On MS-Windows an RGB macro is available and it produces 0x00bbggrr color
* values as used by the MS-Windows GDI api. It should be used only for
* MS-Windows GDI builds. */
-# if defined(RGB) && defined(WIN32) && !defined(FEAT_GUI)
+# if defined(RGB) && defined(MSWIN) && !defined(FEAT_GUI)
# undef RGB
# endif
# ifndef RGB
}
#endif
-#if (defined(WIN3264) && !defined(FEAT_GUI_W32)) || defined(FEAT_TERMINAL) \
+#if (defined(MSWIN) && !defined(FEAT_GUI_MSWIN)) || defined(FEAT_TERMINAL) \
|| defined(PROTO)
static int cube_value[] = {
0x00, 0x5F, 0x87, 0xAF, 0xD7, 0xFF
}
}
#endif
+
char_u *sb_text; // for tl_scrollback_postponed
} sb_line_T;
-#ifdef WIN3264
+#ifdef MSWIN
# ifndef HPCON
# define HPCON VOID*
# endif
char_u *tl_arg0_cmd; // To format the status bar
-#ifdef WIN3264
+#ifdef MSWIN
void *tl_winpty_config;
void *tl_winpty;
/* Terminal active in terminal_loop(). */
static term_T *in_terminal_loop = NULL;
-#ifdef WIN3264
+#ifdef MSWIN
static BOOL has_winpty = FALSE;
static BOOL has_conpty = FALSE;
#endif
static void
setup_job_options(jobopt_T *opt, int rows, int cols)
{
-#ifndef WIN3264
+#ifndef MSWIN
/* Win32: Redirecting the job output won't work, thus always connect stdout
* here. */
if (!(opt->jo_set & JO_OUT_IO))
opt->jo_set |= JO_OUT_IO + JO_OUT_BUF + JO_OUT_MODIFIABLE;
}
-#ifndef WIN3264
+#ifndef MSWIN
/* Win32: Redirecting the job output won't work, thus always connect stderr
* here. */
if (!(opt->jo_set & JO_ERR_IO))
curbuf->b_p_ma = FALSE;
set_term_and_win_size(term);
-#ifdef WIN3264
+#ifdef MSWIN
mch_memmove(orig_opt.jo_io, opt->jo_io, sizeof(orig_opt.jo_io));
#endif
setup_job_options(opt, term->tl_rows, term->tl_cols);
vim_free(buf);
*p = ' ';
}
-#ifdef WIN3264
+#ifdef MSWIN
else if ((int)(p - cmd) == 4 && STRNICMP(cmd, "type", 4) == 0
&& ep != NULL)
{
if (fprintf(fd, "terminal ++curwin ++cols=%d ++rows=%d ",
term->tl_cols, term->tl_rows) < 0)
return FAIL;
-#ifdef WIN3264
+#ifdef MSWIN
if (fprintf(fd, "++type=%s ", term->tl_job->jv_tty_type) < 0)
return FAIL;
#endif
vim_free(term->tl_opencmd);
vim_free(term->tl_eof_chars);
vim_free(term->tl_arg0_cmd);
-#ifdef WIN3264
+#ifdef MSWIN
if (term->tl_out_fd != NULL)
fclose(term->tl_out_fd);
#endif
size_t len = STRLEN(msg);
term_T *term = buffer->b_term;
-#ifdef WIN3264
+#ifdef MSWIN
/* Win32: Cannot redirect output of the job, intercept it here and write to
* the file. */
if (term->tl_out_fd != NULL)
int empty = (buf->b_ml.ml_flags & ML_EMPTY);
linenr_T lnum = buf->b_ml.ml_line_count;
-#ifdef WIN3264
+#ifdef MSWIN
if (!enc_utf8 && enc_codepage > 0)
{
WCHAR *ret = NULL;
State = TERMINAL;
got_int = FALSE;
-#ifdef WIN3264
+#ifdef MSWIN
ctrl_break_was_pressed = FALSE;
#endif
c = vgetc();
for (item = l->lv_first; item != NULL; item = item->li_next)
{
char_u *s = tv_get_string(&item->li_tv);
-#ifdef WIN3264
+#ifdef MSWIN
char_u *tmp = s;
if (!enc_utf8 && enc_codepage > 0)
#endif
channel_send(curbuf->b_term->tl_job->jv_channel, PART_IN,
s, (int)STRLEN(s), NULL);
-#ifdef WIN3264
+#ifdef MSWIN
if (tmp != s)
vim_free(s);
#endif
}
#endif
-#ifdef WIN3264
+#ifdef MSWIN
/* On Windows winpty handles CTRL-C, don't send a CTRL_C_EVENT.
* Use CTRL-BREAK to kill the job. */
if (ctrl_break_was_pressed)
goto theend;
}
}
-# ifdef WIN3264
+# ifdef MSWIN
if (!enc_utf8 && has_mbyte && c >= 0x80)
{
WCHAR wc;
// Empty corrupted data of winpty
else if (STRNCMP(" - ", (char_u *)value->string, 4) == 0)
term->tl_title = NULL;
-#ifdef WIN3264
+#ifdef MSWIN
else if (!enc_utf8 && enc_codepage > 0)
{
WCHAR *ret = NULL;
VIM_CLEAR(term->tl_title);
VIM_CLEAR(term->tl_status_text);
-#ifdef WIN3264
+#ifdef MSWIN
if (term->tl_out_fd != NULL)
{
fclose(term->tl_out_fd);
ScreenLinesUC[off] = NUL;
}
}
-#ifdef WIN3264
+#ifdef MSWIN
else if (has_mbyte && c >= 0x80)
{
char_u mb[MB_MAXBYTES+1];
}
else
{
-#if defined(WIN3264) && !defined(FEAT_GUI_W32)
+#if defined(MSWIN) && !defined(FEAT_GUI_MSWIN)
int tmp;
#endif
if (cterm_normal_fg_color > 0)
{
cterm_color2vterm(cterm_normal_fg_color - 1, fg);
-# if defined(WIN3264) && !defined(FEAT_GUI_W32)
+# if defined(MSWIN) && !defined(FEAT_GUI_MSWIN)
tmp = fg->red;
fg->red = fg->blue;
fg->blue = tmp;
if (cterm_normal_bg_color > 0)
{
cterm_color2vterm(cterm_normal_bg_color - 1, bg);
-# if defined(WIN3264) && !defined(FEAT_GUI_W32)
+# if defined(MSWIN) && !defined(FEAT_GUI_MSWIN)
tmp = bg->red;
bg->red = bg->blue;
bg->blue = tmp;
/* For unix do not use a blinking cursor. In an xterm this causes the
* cursor to blink if it's blinking in the xterm.
* For Windows we respect the system wide setting. */
-#ifdef WIN3264
+#ifdef MSWIN
if (GetCaretBlinkTime() == INFINITE)
value.boolean = 0;
else
(int)STRLEN(term->tl_eof_chars), NULL);
channel_send(ch, PART_IN, (char_u *)"\r", 1, NULL);
}
-# ifdef WIN3264
+# ifdef MSWIN
else
/* Default: CTRL-D */
channel_send(ch, PART_IN, (char_u *)"\004\r", 2, NULL);
}
#endif
-# if defined(WIN3264) || defined(PROTO)
+# if defined(MSWIN) || defined(PROTO)
/**************************************
* 2. MS-Windows implementation.
/* Don't output anything in silent mode ("ex -s") unless 'verbose' set */
if (!(silent_mode && p_verbose == 0))
{
-#if !defined(WIN3264)
+#if !defined(MSWIN)
char_u *tofree = NULL;
if (output_conv.vc_type != CONV_NONE)
mch_write(s, len);
-# if !defined(WIN3264)
+# if !defined(MSWIN)
if (output_conv.vc_type != CONV_NONE)
vim_free(tofree);
# endif
#endif
}
-#if defined(UNIX) || defined(VMS) || defined(PROTO) || defined(WIN3264)
+#if defined(UNIX) || defined(VMS) || defined(PROTO) || defined(MSWIN)
/*
* When executing an external program, there may be some typed characters that
* are not consumed by it. Give them back to ui_inchar() and they are stored
#endif /* FEAT_MOUSE */
-#if defined(FEAT_GUI) || defined(WIN3264) || defined(PROTO)
+#if defined(FEAT_GUI) || defined(MSWIN) || defined(PROTO)
/*
* Called when focus changed. Used for the GUI or for systems where this can
* be done in the console (Win32).
u_getbot();
}
-#if !defined(UNIX) && !defined(WIN32)
+#if !defined(UNIX) && !defined(MSWIN)
/*
* With Amiga we can't handle big undo's, because
* then u_alloc_line would have to allocate a block larger than 32K
if (!write_ok)
semsg(_("E829: write error in undo file: %s"), file_name);
-#if defined(WIN3264)
+#if defined(MSWIN)
/* Copy file attributes; for systems where this can only be done after
* closing the file. */
if (buf->b_ffname != NULL)
#else
"-digraphs",
#endif
-#ifdef FEAT_GUI_W32
+#ifdef FEAT_GUI_MSWIN
# ifdef FEAT_DIRECTX
"+directx",
# else
#else
"-num64",
#endif
-#ifdef FEAT_GUI_W32
+#ifdef FEAT_GUI_MSWIN
# ifdef FEAT_OLE
"+ole",
# else
"-viminfo",
#endif
"+vreplace",
-#ifdef WIN3264
+#ifdef MSWIN
# ifdef FEAT_VTP
"+vtp",
# else
#else
"-xim",
#endif
-#ifdef WIN3264
+#ifdef MSWIN
# ifdef FEAT_XPM_W32
"+xpm_w32",
# else
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 941,
/**/
940,
/**/
*/
init_longVersion();
msg(longVersion);
-#ifdef WIN3264
-# ifdef FEAT_GUI_W32
+#ifdef MSWIN
+# ifdef FEAT_GUI_MSWIN
# ifdef _WIN64
msg_puts(_("\nMS-Windows 64-bit GUI version"));
# else
msg_puts(_("\nMS-Windows 32-bit GUI version"));
# endif
-# ifdef FEAT_OLE
+# ifdef FEAT_OLE
msg_puts(_(" with OLE support"));
-# endif
+# endif
# else
# ifdef _WIN64
msg_puts(_("\nMS-Windows 64-bit console version"));
#include "protodef.h"
-/* use fastcall for Borland, when compiling for Win32 */
-#if defined(__BORLANDC__) && defined(WIN32) && !defined(DEBUG)
+// _WIN32 is defined as 1 when the compilation target is 32-bit or 64-bit.
+// Note: If you want to check for 64-bit use the _WIN64 macro.
+#if defined(WIN32) || defined(_WIN32)
+# define MSWIN
+# ifdef FEAT_GUI
+# define FEAT_GUI_MSWIN
+# endif
+#endif
+
+// use fastcall for Borland, when compiling for MS-Windows
+#if defined(__BORLANDC__) && defined(MSWIN) && !defined(DEBUG)
#if defined(FEAT_PERL) || \
defined(FEAT_PYTHON) || \
defined(FEAT_PYTHON3) || \
# endif
#endif
-#if defined(WIN32) || defined(_WIN64)
+#ifdef MSWIN
# include "vimio.h"
#endif
|| defined(FEAT_GUI_GTK) \
|| defined(FEAT_GUI_ATHENA) \
|| defined(FEAT_GUI_MAC) \
- || defined(FEAT_GUI_W32) \
+ || defined(FEAT_GUI_MSWIN) \
|| defined(FEAT_GUI_PHOTON)
# define FEAT_GUI_ENABLED /* also defined with NO_X11_INCLUDES */
# if !defined(FEAT_GUI) && !defined(NO_X11_INCLUDES)
# define _CRT_NONSTDC_NO_DEPRECATE
#endif
-#if defined(FEAT_GUI_W32)
-# define FEAT_GUI_MSWIN
-#endif
-#if defined(WIN32) || defined(_WIN64)
-# define MSWIN
-#endif
-/* Practically everything is common to both Win32 and Win64 */
-#if defined(WIN32) || defined(_WIN64)
-# define WIN3264
-#endif
-
/*
* VIM_SIZEOF_INT is used in feature.h, and the system-specific included files
* need items from feature.h. Therefore define VIM_SIZEOF_INT here.
*/
-#ifdef WIN3264
+#ifdef MSWIN
# define VIM_SIZEOF_INT 4
#endif
# include "os_amiga.h"
#endif
-#ifdef WIN3264
+#ifdef MSWIN
# include "os_win32.h"
#endif
# include <sys/stat.h>
#endif
-#if defined(HAVE_ERRNO_H) \
- || defined(WIN32) || defined(_WIN64)
+#if defined(HAVE_ERRNO_H) || defined(MSWIN)
# include <errno.h>
#endif
#ifndef HAVE_SELECT
# ifdef HAVE_SYS_POLL_H
# include <sys/poll.h>
-# elif defined(WIN32)
+# elif defined(MSWIN)
# define HAVE_SELECT
# else
# ifdef HAVE_POLL_H
#define MB_MAXBYTES 21
#if (defined(FEAT_PROFILE) || defined(FEAT_RELTIME)) && !defined(PROTO)
-# ifdef WIN3264
+# ifdef MSWIN
typedef LARGE_INTEGER proftime_T;
# else
typedef struct timeval proftime_T;
#ifdef PROTO
typedef long time_T;
#else
-# ifdef WIN3264
+# ifdef MSWIN
typedef __time64_t time_T;
# else
typedef time_t time_T;
# define SELECT_MODE_WORD 1
# define SELECT_MODE_LINE 2
-# ifdef FEAT_GUI_W32
+# ifdef FEAT_GUI_MSWIN
# ifdef FEAT_OLE
# define WM_OLE (WM_APP+0)
# endif
#endif
# if defined(FEAT_EVAL) \
- && (!defined(FEAT_GUI_W32) \
+ && (!defined(FEAT_GUI_MSWIN) \
|| !(defined(FEAT_MBYTE_IME) || defined(GLOBAL_IME))) \
&& !(defined(FEAT_GUI_MAC) && defined(MACOS_CONVERT))
/* Whether IME is supported by im_get_status() defined in mbyte.c.
#if defined(FEAT_XIM) \
|| defined(IME_WITHOUT_XIM) \
- || (defined(FEAT_GUI_W32) \
+ || (defined(FEAT_GUI_MSWIN) \
&& (defined(FEAT_MBYTE_IME) || defined(GLOBAL_IME))) \
|| defined(FEAT_GUI_MAC)
/* im_set_active() is available */
/* This must come after including proto.h.
* For VMS this is defined in macros.h. */
-#if !defined(WIN3264) && !defined(VMS)
+#if !defined(MSWIN) && !defined(VMS)
# define mch_open(n, m, p) open((n), (m), (p))
# define mch_fopen(n, p) fopen((n), (p))
#endif
#endif
/* stop using fastcall for Borland */
-#if defined(__BORLANDC__) && defined(WIN32) && !defined(DEBUG)
+#if defined(__BORLANDC__) && defined(MSWIN) && !defined(DEBUG)
#pragma option -p.
#endif
# define MAX_OPEN_CHANNELS 0
#endif
-#if defined(WIN32)
+#if defined(MSWIN)
# define MAX_NAMED_PIPE_SIZE 65535
#endif
# define ELAPSED_FUNC(v) elapsed(&v)
typedef struct timeval elapsed_T;
long elapsed(struct timeval *start_tv);
-#elif defined(WIN32)
+#elif defined(MSWIN)
# define ELAPSED_TICKCOUNT
# define ELAPSED_INIT(v) v = GetTickCount()
# define ELAPSED_FUNC(v) elapsed(v)
//
IDR_VIM ICON "vim.ico"
-#ifdef FEAT_GUI_W32
+#ifdef FEAT_GUI
IDR_VIM_ERROR ICON "vim_error.ico"
IDR_VIM_ALERT ICON "vim_alert.ico"
IDR_VIM_INFO ICON "vim_info.ico"
#endif
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "gvim.exe.mnf"
-#endif // FEAT_GUI_W32
+#endif // FEAT_GUI
//
// Type Library
* posix environment.
*/
#ifdef FEAT_CYGWIN_WIN32_CLIPBOARD
-# define WIN3264
+# define MSWIN
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
# include "winclip.pro"
VimClipType_t metadata = { -1, -1, -1, -1 };
HGLOBAL hMem = NULL;
char_u *str = NULL;
-#if defined(WIN3264)
+#if defined(MSWIN)
char_u *to_free = NULL;
#endif
HGLOBAL rawh = NULL;
}
if (str == NULL)
{
-#if defined(WIN3264)
+#if defined(MSWIN)
/* Try to get the clipboard in Unicode if it's not an empty string. */
if (IsClipboardFormatAvailable(CF_UNICODETEXT) && metadata.ucslen != 0)
{
break;
}
-#if defined(WIN3264)
+#if defined(MSWIN)
/* The text is in the active codepage. Convert to
* 'encoding', going through UTF-16. */
acp_to_enc(str, str_size, &to_free, &maxlen);
if (rawh != NULL)
GlobalUnlock(rawh);
CloseClipboard();
-#if defined(WIN3264)
+#if defined(MSWIN)
vim_free(to_free);
#endif
}
HGLOBAL hMemRaw = NULL;
HGLOBAL hMem = NULL;
HGLOBAL hMemVim = NULL;
-# if defined(WIN3264)
+# if defined(MSWIN)
HGLOBAL hMemW = NULL;
# endif
metadata.rawlen = 0;
}
-# if defined(WIN3264)
+# if defined(MSWIN)
{
WCHAR *out;
int len = metadata.txtlen;
{
SetClipboardData(cbd->format, hMemVim);
hMemVim = 0;
-# if defined(WIN3264)
+# if defined(MSWIN)
if (hMemW != NULL)
{
if (SetClipboardData(CF_UNICODETEXT, hMemW) != NULL)
GlobalFree(hMemRaw);
if (hMem)
GlobalFree(hMem);
-# if defined(WIN3264)
+# if defined(MSWIN)
if (hMemW)
GlobalFree(hMemW);
# endif
return enc_str;
}
-#if defined(WIN3264) || defined(PROTO)
+#if defined(MSWIN) || defined(PROTO)
/*
* Convert from the active codepage to 'encoding'.
* Input is "str[str_size]".