From 4f97475d326c2773a78561fb874e4f23c25cbcd9 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 17 Feb 2019 17:44:42 +0100 Subject: patch 8.1.0941: macros for MS-Windows are inconsistent Problem: Macros for MS-Windows are inconsistent, using "32", "3264 and others. Solution: Use MSWIN for all MS-Windows builds. Use FEAT_GUI_MSWIN for the GUI build. (Hirohito Higashi, closes #3932) --- src/GvimExt/gvimext.h | 2 +- src/Make_bc5.mak | 2 +- src/Make_cyg_ming.mak | 2 +- src/Make_ivc.mak | 24 ++++++++--------- src/Make_mvc.mak | 4 +-- src/beval.h | 6 ++--- src/blowfish.c | 2 +- src/channel.c | 56 +++++++++++++++++++-------------------- src/edit.c | 6 ++--- src/eval.c | 18 ++++++------- src/evalfunc.c | 44 +++++++++++++++---------------- src/ex_cmds.c | 10 +++---- src/ex_cmds2.c | 46 ++++++++++++++++---------------- src/ex_docmd.c | 6 ++--- src/ex_getln.c | 6 ++--- src/feature.h | 48 +++++++++++++++++----------------- src/fileio.c | 54 +++++++++++++++++++------------------- src/getchar.c | 6 ++--- src/glbl_ime.cpp | 2 +- src/globals.h | 10 +++---- src/gui.c | 18 +++++++------ src/gui.h | 4 +-- src/gui_beval.c | 12 ++++----- src/gui_gtk.c | 2 +- src/gui_gtk_f.c | 2 +- src/gui_gtk_x11.c | 2 +- src/if_cscope.c | 24 ++++++++--------- src/if_cscope.h | 4 +-- src/if_lua.c | 2 +- src/if_mzsch.c | 12 ++++----- src/if_ole.cpp | 2 +- src/if_perl.xs | 6 ++--- src/if_python.c | 4 +-- src/if_python3.c | 4 +-- src/if_ruby.c | 10 +++---- src/if_tcl.c | 6 ++--- src/macros.h | 8 +++--- src/main.c | 62 ++++++++++++++++++++++---------------------- src/mbyte.c | 40 ++++++++++++++-------------- src/memfile.c | 4 +-- src/memline.c | 22 ++++++++-------- src/menu.c | 46 ++++++++++++++++---------------- src/message.c | 14 +++++----- src/misc1.c | 18 ++++++------- src/misc2.c | 14 +++++----- src/nbdebug.c | 2 +- src/netbeans.c | 6 ++--- src/normal.c | 2 +- src/option.c | 62 ++++++++++++++++++++++---------------------- src/option.h | 14 ++++------ src/os_mswin.c | 4 +-- src/os_unix.c | 2 +- src/os_w32exe.c | 4 +-- src/os_win32.c | 72 +++++++++++++++++++++++++-------------------------- src/os_win32.h | 4 +-- src/proto.h | 4 +-- src/screen.c | 4 +-- src/search.c | 2 +- src/structs.h | 16 ++++++------ src/syntax.c | 8 +++--- src/term.c | 15 ++++++----- src/terminal.c | 50 +++++++++++++++++------------------ src/ui.c | 8 +++--- src/undo.c | 4 +-- src/version.c | 18 +++++++------ src/vim.h | 55 +++++++++++++++++++-------------------- src/vim.rc | 4 +-- src/winclip.c | 20 +++++++------- 68 files changed, 537 insertions(+), 539 deletions(-) diff --git a/src/GvimExt/gvimext.h b/src/GvimExt/gvimext.h index e17f2ac2c9..7a4e009fdb 100644 --- a/src/GvimExt/gvimext.h +++ b/src/GvimExt/gvimext.h @@ -31,7 +31,7 @@ # 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 diff --git a/src/Make_bc5.mak b/src/Make_bc5.mak index 30fe727b2e..04f78854d9 100644 --- a/src/Make_bc5.mak +++ b/src/Make_bc5.mak @@ -405,7 +405,7 @@ DEFINES = $(DEFINES) -DFEAT_CSCOPE !endif !if ("$(GUI)"=="yes") -DEFINES = $(DEFINES) -DFEAT_GUI_W32 -DFEAT_CLIPBOARD +DEFINES = $(DEFINES) -DFEAT_GUI -DFEAT_CLIPBOARD !if ("$(DEBUG)"=="yes") TARGET = gvimd.exe !else diff --git a/src/Make_cyg_ming.mak b/src/Make_cyg_ming.mak index f6ae85316f..06bf07a105 100644 --- a/src/Make_cyg_ming.mak +++ b/src/Make_cyg_ming.mak @@ -491,7 +491,7 @@ endif # RUBY # 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) diff --git a/src/Make_ivc.mak b/src/Make_ivc.mak index 26367e096b..02910bcf43 100644 --- a/src/Make_ivc.mak +++ b/src/Make_ivc.mak @@ -92,8 +92,8 @@ LINK32_FLAGS= oldnames.lib kernel32.lib user32.lib gdi32.lib version.lib comdlg3 # 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" @@ -105,8 +105,8 @@ INTDIR=.\oleRel 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 @@ -124,8 +124,8 @@ INTDIR=.\oleDbg 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 @@ -144,8 +144,8 @@ INTDIR=.\gRel 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 @@ -163,8 +163,8 @@ INTDIR=.\gDbg 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 @@ -508,7 +508,7 @@ SOURCE=.\if_ole.cpp # 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 @@ -519,7 +519,7 @@ SOURCE=.\if_ole.cpp # 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 diff --git a/src/Make_mvc.mak b/src/Make_mvc.mak index c81fbd2961..391277fe71 100644 --- a/src/Make_mvc.mak +++ b/src/Make_mvc.mak @@ -791,8 +791,8 @@ OBJ = $(OBJ) $(OUTDIR)\dimm_i.obj $(OUTDIR)\glbl_ime.obj !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 diff --git a/src/beval.h b/src/beval.h index 21900c5ad4..090c5fb55c 100644 --- a/src/beval.h +++ b/src/beval.h @@ -43,7 +43,7 @@ typedef struct BalloonEvalStruct 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; @@ -63,7 +63,7 @@ typedef struct BalloonEvalStruct 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 @@ -76,7 +76,7 @@ typedef struct BalloonEvalStruct int *vts; // vartabstop setting for this buffer #endif char_u *msg; -#ifdef FEAT_GUI_W32 +#ifdef FEAT_GUI_MSWIN void *tofree; #endif } BalloonEval; diff --git a/src/blowfish.c b/src/blowfish.c index 8ca0e2848c..7bc3e31d35 100644 --- a/src/blowfish.c +++ b/src/blowfish.c @@ -34,7 +34,7 @@ typedef union { char_u uc[8]; } block8; -#if defined(WIN3264) +#if defined(MSWIN) /* MS-Windows is always little endian */ #else # ifdef HAVE_CONFIG_H diff --git a/src/channel.c b/src/channel.c index d728c77d9f..57bb4ccffa 100644 --- a/src/channel.c +++ b/src/channel.c @@ -20,7 +20,7 @@ #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() @@ -65,7 +65,7 @@ static int safe_to_invoke_callback = 0; static char *part_names[] = {"sock", "out", "err", "in"}; -#ifdef WIN32 +#ifdef MSWIN static int fd_read(sock_T fd, char *buf, size_t len) { @@ -234,7 +234,7 @@ ch_error(channel_T *ch, const char *fmt, ...) } } -#ifdef _WIN32 +#ifdef MSWIN # undef PERROR # define PERROR(msg) (void)semsg("%s: %s", msg, strerror_win32(errno)) @@ -687,7 +687,7 @@ channel_open( int sd = -1; struct sockaddr_in server; struct hostent *host; -#ifdef WIN32 +#ifdef MSWIN u_short port = port_in; u_long val = 1; #else @@ -696,7 +696,7 @@ channel_open( channel_T *channel; int ret; -#ifdef WIN32 +#ifdef MSWIN channel_init_winsock(); #endif @@ -758,7 +758,7 @@ channel_open( { /* Make connect() non-blocking. */ if ( -#ifdef _WIN32 +#ifdef MSWIN ioctlsocket(sd, FIONBIO, &val) < 0 #else fcntl(sd, F_SETFL, O_NONBLOCK) < 0 @@ -804,14 +804,14 @@ channel_open( /* 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; @@ -824,7 +824,7 @@ channel_open( tv.tv_sec = waitnow / 1000; tv.tv_usec = (waitnow % 1000) * 1000; -#ifndef WIN32 +#ifndef MSWIN gettimeofday(&start_tv, NULL); #endif ch_log(channel, @@ -842,7 +842,7 @@ channel_open( 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)) @@ -893,7 +893,7 @@ channel_open( #endif } -#ifndef WIN32 +#ifndef MSWIN if (waittime > 1 && elapsed_msec < waittime) { /* The port isn't ready but we also didn't get an error. @@ -930,7 +930,7 @@ channel_open( if (waittime >= 0) { -#ifdef _WIN32 +#ifdef MSWIN val = 0; ioctlsocket(sd, FIONBIO, &val); #else @@ -1029,7 +1029,7 @@ ch_close_part(channel_T *channel, ch_part_T part) && (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 @@ -1427,7 +1427,7 @@ can_write_buf_line(channel_T *channel) in_part->ch_block_write = 1; /* TODO: Win32 implementation, probably using WaitForMultipleObjects() */ -#ifndef WIN32 +#ifndef MSWIN { # if defined(HAVE_SELECT) struct timeval tval; @@ -1759,7 +1759,7 @@ channel_get_all(channel_T *channel, ch_part_T part, int *outlen) { if (*p == NUL) *p = NL; -#ifdef WIN32 +#ifdef MSWIN else if (*p == 0x1b) { // crush the escape sequence OSC 0/1/2: ESC ]0; @@ -2064,7 +2064,7 @@ channel_parse_json(channel_T *channel, ch_part_T part) (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); @@ -2079,7 +2079,7 @@ channel_parse_json(channel_T *channel, ch_part_T part) else { int timeout; -#ifdef WIN32 +#ifdef MSWIN timeout = GetTickCount() > chanpart->ch_deadline; #else { @@ -3198,7 +3198,7 @@ channel_wait(channel_T *channel, sock_T fd, int timeout) 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; @@ -3554,7 +3554,7 @@ channel_read_json_block( timeout = timeout_arg; if (chanpart->ch_wait_len > 0) { -#ifdef WIN32 +#ifdef MSWIN timeout = chanpart->ch_deadline - GetTickCount() + 1; #else { @@ -3680,7 +3680,7 @@ theend: 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. @@ -3707,7 +3707,7 @@ channel_fd2channel(sock_T fd, ch_part_T *partp) } # 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. @@ -3772,7 +3772,7 @@ channel_set_nonblock(channel_T *channel, ch_part_T part) if (fd != INVALID_FD) { -#ifdef _WIN32 +#ifdef MSWIN u_long val = 1; ioctlsocket(fd, FIONBIO, &val); @@ -3853,7 +3853,7 @@ channel_send( else { res = fd_write(fd, (char *)buf, len); -#ifdef WIN32 +#ifdef MSWIN if (channel->ch_named_pipe && res < 0) { DisconnectNamedPipe((HANDLE)fd); @@ -4213,7 +4213,7 @@ channel_poll_check(int ret_in, void *fds_in) } # 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. @@ -4313,7 +4313,7 @@ channel_select_check(int ret_in, void *rfds_in, void *wfds_in) return ret; } -# endif /* !WIN32 && HAVE_SELECT */ +# endif /* !MSWIN && HAVE_SELECT */ /* * Execute queued up commands. @@ -5039,7 +5039,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2) 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 ) @@ -5199,7 +5199,7 @@ job_free_contents(job_T *job) #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); @@ -5971,7 +5971,7 @@ job_info(job_T *job, dict_T *dict) #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 diff --git a/src/edit.c b/src/edit.c index 62ff03d962..2f81b52dff 100644 --- a/src/edit.c +++ b/src/edit.c @@ -1247,9 +1247,9 @@ doESCkey: did_cursorhold = TRUE; break; -#ifdef FEAT_GUI_W32 - /* On Win32 ignore , we get it when closing the window was - * cancelled. */ +#ifdef FEAT_GUI_MSWIN + /* On MS-Windows ignore , we get it when closing the window + * was cancelled. */ case K_F4: if (mod_mask != MOD_MASK_ALT) goto normalchar; diff --git a/src/eval.c b/src/eval.c index 56a26b1aea..f66d296502 100644 --- a/src/eval.c +++ b/src/eval.c @@ -7460,7 +7460,7 @@ tv_get_string_buf_chk(typval_T *varp, char_u *buf) # 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, @@ -9956,7 +9956,7 @@ var_exists(char_u *var) #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. */ @@ -10191,7 +10191,7 @@ shortpath_for_partial( return OK; } -#endif /* WIN3264 */ +#endif // MSWIN /* * Adjust a filename, according to a string of modifiers. @@ -10215,7 +10215,7 @@ modify_fname( char_u dirname[MAXPATHL]; int c; int has_fullname = 0; -#ifdef WIN3264 +#ifdef MSWIN char_u *fname_start = *fnamep; int has_shortname = 0; #endif @@ -10270,7 +10270,7 @@ repeat: return -1; } -#ifdef WIN3264 +#ifdef MSWIN # if _WIN32_WINNT >= 0x0500 if (vim_strchr(*fnamep, '~') != NULL) { @@ -10313,7 +10313,7 @@ repeat: *usedlen += 2; if (c == '8') { -#ifdef WIN3264 +#ifdef MSWIN has_shortname = 1; /* Postpone this. */ #endif continue; @@ -10406,12 +10406,12 @@ repeat: 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'. */ @@ -10455,7 +10455,7 @@ repeat: *fnamelen = l; } } -#endif /* WIN3264 */ +#endif // MSWIN /* ":t" - tail, just the basename */ if (src[*usedlen] == ':' && src[*usedlen + 1] == 't') diff --git a/src/evalfunc.c b/src/evalfunc.c index e9f63423a8..e94d875da9 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -123,7 +123,7 @@ static void f_cosh(typval_T *argvars, typval_T *rettv); 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); @@ -599,7 +599,7 @@ static struct fst {"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}, @@ -2884,7 +2884,7 @@ f_cursor(typval_T *argvars, typval_T *rettv) rettv->vval.v_number = 0; } -#ifdef WIN3264 +#ifdef MSWIN /* * "debugbreak()" function */ @@ -4137,7 +4137,7 @@ f_foreground(typval_T *argvars UNUSED, typval_T *rettv UNUSED) if (gui.in_use) gui_mch_set_foreground(); #else -# ifdef WIN32 +# ifdef MSWIN win32_set_foreground(); # endif #endif @@ -6152,7 +6152,7 @@ f_has(typval_T *argvars, typval_T *rettv) #ifdef VMS "vms", #endif -#ifdef WIN32 +#ifdef MSWIN "win32", #endif #if defined(UNIX) && (defined(__CYGWIN32__) || defined(__CYGWIN__)) @@ -6182,7 +6182,7 @@ f_has(typval_T *argvars, typval_T *rettv) #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 @@ -6196,7 +6196,7 @@ f_has(typval_T *argvars, typval_T *rettv) # endif #endif #if defined(FEAT_BROWSE) && (defined(USE_FILE_CHOOSER) \ - || defined(FEAT_GUI_W32) \ + || defined(FEAT_GUI_MSWIN) \ || defined(FEAT_GUI_MOTIF)) "browsefilter", #endif @@ -6322,7 +6322,7 @@ f_has(typval_T *argvars, typval_T *rettv) #ifdef FEAT_GUI_PHOTON "gui_photon", #endif -#ifdef FEAT_GUI_W32 +#ifdef FEAT_GUI_MSWIN "gui_win32", #endif #ifdef FEAT_HANGULIN @@ -6526,7 +6526,7 @@ f_has(typval_T *argvars, typval_T *rettv) #ifdef FEAT_TERMGUICOLORS "termguicolors", #endif -#if defined(FEAT_TERMINAL) && !defined(WIN3264) +#if defined(FEAT_TERMINAL) && !defined(MSWIN) "terminal", #endif #ifdef TERMINFO @@ -6658,7 +6658,7 @@ f_has(typval_T *argvars, typval_T *rettv) 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 @@ -6731,11 +6731,11 @@ f_has(typval_T *argvars, typval_T *rettv) 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 @@ -9309,7 +9309,7 @@ list2proftime(typval_T *arg, proftime_T *tm) 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 @@ -9354,7 +9354,7 @@ f_reltime(typval_T *argvars UNUSED, typval_T *rettv UNUSED) { long n1, n2; -# ifdef WIN3264 +# ifdef MSWIN n1 = res.HighPart; n2 = res.LowPart; # else @@ -9443,7 +9443,7 @@ remote_common(typval_T *argvars, typval_T *rettv, int expr) char_u *r = NULL; char_u buf[NUMBUFLEN]; int timeout = 0; -# ifdef WIN32 +# ifdef MSWIN HWND w; # else Window w; @@ -9464,7 +9464,7 @@ remote_common(typval_T *argvars, typval_T *rettv, int expr) 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, @@ -9522,7 +9522,7 @@ f_remote_expr(typval_T *argvars UNUSED, typval_T *rettv) 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]); @@ -9549,7 +9549,7 @@ f_remote_peek(typval_T *argvars UNUSED, typval_T *rettv) #ifdef FEAT_CLIENTSERVER dictitem_T v; char_u *s = NULL; -# ifdef WIN32 +# ifdef MSWIN long_u n = 0; # endif char_u *serverid; @@ -9565,7 +9565,7 @@ f_remote_peek(typval_T *argvars UNUSED, typval_T *rettv) 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; @@ -9609,7 +9609,7 @@ f_remote_read(typval_T *argvars UNUSED, typval_T *rettv) 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 @@ -9617,7 +9617,7 @@ f_remote_read(typval_T *argvars UNUSED, typval_T *rettv) 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); @@ -10789,7 +10789,7 @@ f_serverlist(typval_T *argvars UNUSED, typval_T *rettv) char_u *r = NULL; #ifdef FEAT_CLIENTSERVER -# ifdef WIN32 +# ifdef MSWIN r = serverGetVimNames(); # else make_connection(); diff --git a/src/ex_cmds.c b/src/ex_cmds.c index 79b9bc11d4..da10c1291a 100644 --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -1618,7 +1618,7 @@ do_shell( */ #ifndef FEAT_GUI_MSWIN if (cmd == NULL -# ifdef WIN3264 +# ifdef MSWIN || (winstart && !need_wait_return) # endif ) @@ -1643,7 +1643,7 @@ do_shell( # endif no_wait_return = save_nwr; } -#endif /* FEAT_GUI_W32 */ +#endif /* FEAT_GUI_MSWIN */ #ifdef MSWIN if (!winstart) /* if winstart==TRUE, never stopped termcap! */ @@ -1935,7 +1935,7 @@ write_viminfo(char_u *file, int forceit) 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 @@ -1999,7 +1999,7 @@ write_viminfo(char_u *file, int forceit) goto end; } #endif -#ifdef WIN3264 +#ifdef MSWIN /* Get the file attributes of the existing viminfo file. */ hidden = mch_ishidden(fname); #endif @@ -2195,7 +2195,7 @@ write_viminfo(char_u *file, int forceit) ++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); diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c index 4bf2072723..5418804c58 100644 --- a/src/ex_cmds2.c +++ b/src/ex_cmds2.c @@ -1048,7 +1048,7 @@ dbg_breakpoint(char_u *name, linenr_T lnum) void profile_start(proftime_T *tm) { -# ifdef WIN3264 +# ifdef MSWIN QueryPerformanceCounter(tm); # else gettimeofday(tm, NULL); @@ -1063,7 +1063,7 @@ profile_end(proftime_T *tm) { proftime_T now; -# ifdef WIN3264 +# ifdef MSWIN QueryPerformanceCounter(&now); tm->QuadPart = now.QuadPart - tm->QuadPart; # else @@ -1084,7 +1084,7 @@ profile_end(proftime_T *tm) void profile_sub(proftime_T *tm, proftime_T *tm2) { -# ifdef WIN3264 +# ifdef MSWIN tm->QuadPart -= tm2->QuadPart; # else tm->tv_usec -= tm2->tv_usec; @@ -1106,7 +1106,7 @@ profile_msg(proftime_T *tm) { static char buf[50]; -# ifdef WIN3264 +# ifdef MSWIN LARGE_INTEGER fr; QueryPerformanceFrequency(&fr); @@ -1124,7 +1124,7 @@ profile_msg(proftime_T *tm) float_T profile_float(proftime_T *tm) { -# ifdef WIN3264 +# ifdef MSWIN LARGE_INTEGER fr; QueryPerformanceFrequency(&fr); @@ -1145,7 +1145,7 @@ profile_setlimit(long msec, proftime_T *tm) profile_zero(tm); else { -# ifdef WIN3264 +# ifdef MSWIN LARGE_INTEGER fr; QueryPerformanceCounter(tm); @@ -1170,7 +1170,7 @@ profile_passed_limit(proftime_T *tm) { proftime_T now; -# ifdef WIN3264 +# ifdef MSWIN if (tm->QuadPart == 0) /* timer was not set */ return FALSE; QueryPerformanceCounter(&now); @@ -1190,7 +1190,7 @@ profile_passed_limit(proftime_T *tm) void profile_zero(proftime_T *tm) { -# ifdef WIN3264 +# ifdef MSWIN tm->QuadPart = 0; # else tm->tv_usec = 0; @@ -1207,7 +1207,7 @@ static long last_timer_id = 0; long proftime_time_left(proftime_T *due, proftime_T *now) { -# ifdef WIN3264 +# ifdef MSWIN LARGE_INTEGER fr; if (now->QuadPart > due->QuadPart) @@ -1592,7 +1592,7 @@ profile_divide(proftime_T *tm, int count, proftime_T *tm2) 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; @@ -1617,7 +1617,7 @@ static proftime_T prof_wait_time; void profile_add(proftime_T *tm, proftime_T *tm2) { -# ifdef WIN3264 +# ifdef MSWIN tm->QuadPart += tm2->QuadPart; # else tm->tv_usec += tm2->tv_usec; @@ -1638,7 +1638,7 @@ profile_self(proftime_T *self, proftime_T *total, proftime_T *children) { /* Check that the result won't be negative. Can happen with recursive * calls. */ -#ifdef WIN3264 +#ifdef MSWIN if (total->QuadPart <= children->QuadPart) return; #else @@ -1678,7 +1678,7 @@ profile_sub_wait(proftime_T *tm, proftime_T *tma) 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); @@ -1691,7 +1691,7 @@ profile_equal(proftime_T *tm1, proftime_T *tm2) 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) @@ -4286,7 +4286,7 @@ source_level(void *cookie) 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. @@ -4295,7 +4295,7 @@ static char_u *get_one_sourceline(struct source_cookie *sp); 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); @@ -5201,7 +5201,7 @@ get_locale_val(int what) /* Obtain the locale value from the libraries. */ loc = (char_u *)setlocale(what, NULL); -# ifdef WIN32 +# ifdef MSWIN if (loc != NULL) { char_u *p; @@ -5230,7 +5230,7 @@ get_locale_val(int what) #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 @@ -5307,7 +5307,7 @@ get_mess_lang(void) p = mch_getenv((char_u *)"LANG"); } # endif -# ifdef WIN32 +# ifdef MSWIN p = gettext_lang(p); # endif return is_valid_mess_lang(p) ? p : NULL; @@ -5479,7 +5479,7 @@ ex_language(exarg_T *eap) /* 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. */ @@ -5489,7 +5489,7 @@ ex_language(exarg_T *eap) if (what != LC_CTYPE) { char_u *mname; -#ifdef WIN32 +#ifdef MSWIN mname = gettext_lang(name); #else mname = name; @@ -5516,7 +5516,7 @@ ex_language(exarg_T *eap) 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 @@ -5567,7 +5567,7 @@ find_locales(void) static void init_locales(void) { -# ifndef WIN32 +# ifndef MSWIN if (!did_init_locales) { did_init_locales = TRUE; diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 8cdb046747..6e61cca9b3 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -177,7 +177,7 @@ static void ex_edit(exarg_T *eap); # 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 @@ -8866,7 +8866,7 @@ 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) { @@ -9853,7 +9853,7 @@ ex_redraw(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; diff --git a/src/ex_getln.c b/src/ex_getln.c index 0096737b01..3d38d2c742 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -1899,9 +1899,9 @@ getcmdline_int( /* Ignore mouse event or open_cmdwin() result. */ goto cmdline_not_changed; -#ifdef FEAT_GUI_W32 - /* On Win32 ignore , we get it when closing the window was - * cancelled. */ +#ifdef FEAT_GUI_MSWIN + /* On MS-Windows ignore , we get it when closing the window + * was cancelled. */ case K_F4: if (mod_mask == MOD_MASK_ALT) { diff --git a/src/feature.h b/src/feature.h index a41e79f6f2..1be1833bfe 100644 --- a/src/feature.h +++ b/src/feature.h @@ -61,7 +61,7 @@ */ #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) @@ -343,10 +343,10 @@ */ #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 @@ -361,7 +361,7 @@ #if defined(FEAT_HUGE) \ && defined(FEAT_EVAL) \ && ((defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)) \ - || defined(WIN3264)) + || defined(MSWIN)) # define FEAT_PROFILE #endif @@ -371,14 +371,14 @@ #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 @@ -603,7 +603,7 @@ * +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 @@ -659,7 +659,7 @@ #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 @@ -669,7 +669,7 @@ */ #ifdef FEAT_NORMAL # define FEAT_MENU -# ifdef FEAT_GUI_W32 +# ifdef FEAT_GUI_MSWIN # define FEAT_TEAROFF # endif #endif @@ -757,7 +757,7 @@ #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 @@ -828,7 +828,7 @@ */ #if defined(FEAT_NORMAL) \ && ((defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)) \ - || defined(WIN3264)) + || defined(MSWIN)) # define STARTUPTIME 1 #endif @@ -1039,7 +1039,7 @@ # 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__) @@ -1136,7 +1136,7 @@ * +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 @@ -1145,7 +1145,7 @@ * 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 @@ -1169,10 +1169,10 @@ */ #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 @@ -1189,7 +1189,7 @@ # 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 @@ -1263,7 +1263,7 @@ # 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 @@ -1274,13 +1274,13 @@ * 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 @@ -1293,7 +1293,7 @@ * +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 @@ -1340,13 +1340,13 @@ * +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 diff --git a/src/fileio.c b/src/fileio.c index 85d2df3bbf..841de1cf01 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -49,7 +49,7 @@ static int time_differs(long t1, long t2); #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 */ @@ -106,7 +106,7 @@ static int need_conversion(char_u *fenc); 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 @@ -1038,7 +1038,7 @@ retry: 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(). @@ -1229,7 +1229,7 @@ retry: 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 @@ -1590,7 +1590,7 @@ retry: } #endif -#ifdef WIN3264 +#ifdef MSWIN if (fio_flags & FIO_CODEPAGE) { char_u *src, *dst; @@ -2559,7 +2559,7 @@ failed: 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 @@ -3601,13 +3601,13 @@ buf_write( */ 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; @@ -3632,7 +3632,7 @@ buf_write( 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; @@ -3715,7 +3715,7 @@ buf_write( && (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; @@ -3744,7 +3744,7 @@ buf_write( 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) @@ -3785,7 +3785,7 @@ buf_write( */ (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 @@ -4018,7 +4018,7 @@ buf_write( */ (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 @@ -4177,7 +4177,7 @@ buf_write( } } -#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: */ @@ -4416,7 +4416,7 @@ restore_backup: vim_ignored = ftruncate(fd, (off_t)0); #endif -#if defined(WIN3264) +#if defined(MSWIN) if (backup != NULL && overwriting && !append) { if (backup_copy) @@ -5430,7 +5430,7 @@ buf_write_bytes(struct bw_info *ip) } } -#ifdef WIN3264 +#ifdef MSWIN else if (flags & FIO_CODEPAGE) { /* @@ -5869,7 +5869,7 @@ get_fio_flags(char_u *ptr) 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". @@ -6041,9 +6041,9 @@ shorten_fname(char_u *full_path, char_u *dir_name) 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. + * 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. */ if (!((len > 2) && (*(p - 2) == ':'))) #endif @@ -6298,7 +6298,7 @@ buf_modname( 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 @@ -6427,7 +6427,7 @@ vim_rename(char_u *from, char_u *to) use_tmp_file = TRUE; } #endif -#ifdef WIN3264 +#ifdef MSWIN { BY_HANDLE_FILE_INFORMATION info1, info2; @@ -7189,7 +7189,7 @@ delete_recursive(char_u *name) /* 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) @@ -7276,7 +7276,7 @@ vim_tempname( { #ifdef USE_TMPNAM char_u itmp[L_tmpnam]; /* use tmpnam() */ -#elif defined(WIN3264) +#elif defined(MSWIN) WCHAR itmp[TEMPNAMELEN]; #else char_u itmp[TEMPNAMELEN]; @@ -7398,7 +7398,7 @@ vim_tempname( #else /* TEMPDIRNAMES */ -# ifdef WIN3264 +# ifdef MSWIN WCHAR wszTempFile[_MAX_PATH + 1]; WCHAR buf4[4]; char_u *retval; @@ -7428,7 +7428,7 @@ vim_tempname( *p = '/'; return retval; -# else /* WIN3264 */ +# else // MSWIN # ifdef USE_TMPNAM char_u *p; @@ -7466,7 +7466,7 @@ vim_tempname( # endif return vim_strsave(itmp); -# endif /* WIN3264 */ +# endif // MSWIN #endif /* TEMPDIRNAMES */ } diff --git a/src/getchar.c b/src/getchar.c index eaef1ab7e4..7039c9c76b 100644 --- a/src/getchar.c +++ b/src/getchar.c @@ -1623,7 +1623,7 @@ vgetc(void) } 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) @@ -1679,7 +1679,7 @@ vgetc(void) 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; @@ -3107,7 +3107,7 @@ fix_input_buffer(char_u *buf, int len) 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 diff --git a/src/glbl_ime.cpp b/src/glbl_ime.cpp index 91d52edf17..1661990742 100644 --- a/src/glbl_ime.cpp +++ b/src/glbl_ime.cpp @@ -134,7 +134,7 @@ global_ime_DefWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) 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 diff --git a/src/globals.h b/src/globals.h index 82e663e9c6..729a269d09 100644 --- a/src/globals.h +++ b/src/globals.h @@ -19,7 +19,7 @@ */ EXTERN long Rows /* nr of rows in the screen */ #ifdef DO_INIT -# if defined(WIN3264) +# if defined(MSWIN) = 25L # else = 24L @@ -818,7 +818,7 @@ EXTERN int enc_dbcs INIT(= 0); /* One of DBCS_xxx values if 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); @@ -826,7 +826,7 @@ EXTERN int enc_latin9 INIT(= FALSE); /* 'encoding' is latin9 */ #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 @@ -1296,7 +1296,7 @@ EXTERN guint32 gtk_socket_id INIT(= 0); 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. @@ -1645,7 +1645,7 @@ EXTERN int did_echo_string_emsg INIT(= FALSE); EXTERN int *eval_lavars_used INIT(= NULL); #endif -#ifdef WIN3264 +#ifdef MSWIN EXTERN int ctrl_break_was_pressed INIT(= FALSE); #endif diff --git a/src/gui.c b/src/gui.c index d993bc6b00..ada338f7f2 100644 --- a/src/gui.c +++ b/src/gui.c @@ -749,7 +749,7 @@ gui_init(void) &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 @@ -2432,7 +2432,7 @@ gui_outstr_nowrap( 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. */ @@ -2568,7 +2568,7 @@ gui_outstr_nowrap( /* 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 @@ -3561,7 +3561,7 @@ gui_init_which_components(char_u *oldval UNUSED) 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); @@ -4125,7 +4125,7 @@ gui_update_scrollbars( /* 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]) @@ -4879,9 +4879,10 @@ gui_mouse_correct(void) /* * 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; @@ -4951,8 +4952,9 @@ ex_gui(exarg_T *eap) 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. */ diff --git a/src/gui.h b/src/gui.h index a57b0a3403..f5f05706f2 100644 --- a/src/gui.h +++ b/src/gui.h @@ -90,7 +90,7 @@ * 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) @@ -406,7 +406,7 @@ typedef struct Gui #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 diff --git a/src/gui_beval.c b/src/gui_beval.c index 3a282181ac..e1e093f375 100644 --- a/src/gui_beval.c +++ b/src/gui_beval.c @@ -13,7 +13,7 @@ #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) @@ -197,10 +197,10 @@ gui_mch_currently_showing_beval(void) 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". @@ -214,10 +214,10 @@ gui_mch_post_balloon(BalloonEval *beval, char_u *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. @@ -1220,6 +1220,6 @@ createBalloonEvalWindow(BalloonEval *beval) } #endif /* !FEAT_GUI_GTK */ -#endif /* !FEAT_GUI_W32 */ +#endif /* !FEAT_GUI_MSWIN */ #endif /* FEAT_BEVAL_GUI */ diff --git a/src/gui_gtk.c b/src/gui_gtk.c index 3d08934840..ba8fd9dc15 100644 --- a/src/gui_gtk.c +++ b/src/gui_gtk.c @@ -76,7 +76,7 @@ # include # endif # include -# ifdef WIN3264 +# ifdef MSWIN # include # else # include diff --git a/src/gui_gtk_f.c b/src/gui_gtk_f.c index 3f376c0484..d81474b3f7 100644 --- a/src/gui_gtk_f.c +++ b/src/gui_gtk_f.c @@ -32,7 +32,7 @@ #if !GTK_CHECK_VERSION(3,0,0) # include #endif -#ifdef WIN3264 +#ifdef MSWIN # include #else # include diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c index b76aacd9cc..5e74adcebe 100644 --- a/src/gui_gtk_x11.c +++ b/src/gui_gtk_x11.c @@ -86,7 +86,7 @@ extern void bonobo_dock_item_set_behavior(BonoboDockItem *dock_item, BonoboDockI # include # endif # include -# ifdef WIN3264 +# ifdef MSWIN # include # else # include diff --git a/src/if_cscope.c b/src/if_cscope.c index 4cc053ed0f..03346749c9 100644 --- a/src/if_cscope.c +++ b/src/if_cscope.c @@ -548,7 +548,7 @@ staterr: goto add_err; while (fname[strlen(fname)-1] == '/' -#ifdef WIN32 +#ifdef MSWIN || fname[strlen(fname)-1] == '\\' #endif ) @@ -790,7 +790,7 @@ cs_create_connection(int i) #endif int len; char *prog, *cmd, *ppath = NULL; -#ifdef WIN32 +#ifdef MSWIN int fd; SECURITY_ATTRIBUTES sa; PROCESS_INFORMATION pi; @@ -844,7 +844,7 @@ err_closing: (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; @@ -874,7 +874,7 @@ err_closing: #ifdef UNIX return CSCOPE_FAILURE; #else - /* WIN32 */ + /* MSWIN */ goto err_closing; #endif } @@ -891,7 +891,7 @@ err_closing: #ifdef UNIX return CSCOPE_FAILURE; #else - /* WIN32 */ + /* MSWIN */ goto err_closing; #endif } @@ -910,7 +910,7 @@ err_closing: #ifdef UNIX return CSCOPE_FAILURE; #else - /* WIN32 */ + /* MSWIN */ goto err_closing; #endif } @@ -919,7 +919,7 @@ err_closing: #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) @@ -971,7 +971,7 @@ err_closing: } #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; @@ -1330,7 +1330,7 @@ clear_csinfo(int i) 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 } @@ -1940,13 +1940,13 @@ cs_pathcomponents(char *path) 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 ) @@ -2433,7 +2433,7 @@ cs_resolve_file(int i, char *name) 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 ) diff --git a/src/if_cscope.h b/src/if_cscope.h index 419c469467..6f3b02dbd7 100644 --- a/src/if_cscope.h +++ b/src/if_cscope.h @@ -11,7 +11,7 @@ #if defined(FEAT_CSCOPE) || defined(PROTO) -#if defined (WIN32) +#if defined (MSWIN) # ifndef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN # endif @@ -45,7 +45,7 @@ typedef struct csi { 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 */ diff --git a/src/if_lua.c b/src/if_lua.c index e650e5e7d1..12643f90c8 100644 --- a/src/if_lua.c +++ b/src/if_lua.c @@ -80,7 +80,7 @@ static luaV_Funcref *luaV_pushfuncref(lua_State *L, typval_T *tv); #ifdef DYNAMIC_LUA -#ifndef WIN3264 +#ifndef MSWIN # include # define HANDLE void* # define load_dll(n) dlopen((n), RTLD_LAZY|RTLD_GLOBAL) diff --git a/src/if_mzsch.c b/src/if_mzsch.c index 16c4c88df5..27925afb3c 100644 --- a/src/if_mzsch.c +++ b/src/if_mzsch.c @@ -47,7 +47,7 @@ typedef int HINSTANCE; * 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 @@ -807,7 +807,7 @@ static long range_end; /* 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) @@ -822,7 +822,7 @@ static EventLoopTimerRef timer_id = NULL; 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) { @@ -847,7 +847,7 @@ static void setup_timer(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) @@ -875,7 +875,7 @@ timer_proc(EventLoopTimerRef theTimer UNUSED, void *userData UNUSED) 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); @@ -891,7 +891,7 @@ setup_timer(void) 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); diff --git a/src/if_ole.cpp b/src/if_ole.cpp index 0888883630..8ee348d662 100644 --- a/src/if_ole.cpp +++ b/src/if_ole.cpp @@ -6,7 +6,7 @@ * 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. * diff --git a/src/if_perl.xs b/src/if_perl.xs index 67d0b94888..2655640755 100644 --- a/src/if_perl.xs +++ b/src/if_perl.xs @@ -100,7 +100,7 @@ // 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 @@ -154,7 +154,7 @@ EXTERN_C void boot_DynaLoader(pTHX_ CV*); #if defined(DYNAMIC_PERL) || defined(PROTO) # ifndef DYNAMIC_PERL /* just generating prototypes */ -# ifdef WIN3264 +# ifdef MSWIN typedef int HANDLE; # endif typedef int XSINIT_t; @@ -164,7 +164,7 @@ typedef int XSUBADDR_t; typedef int perl_key; # endif -# ifndef WIN3264 +# ifndef MSWIN # include # define HANDLE void* # define PERL_PROC void* diff --git a/src/if_python.c b/src/if_python.c index 343804668b..06c46bc37b 100644 --- a/src/if_python.c +++ b/src/if_python.c @@ -35,7 +35,7 @@ # undef _POSIX_THREADS #endif -#if defined(_WIN32) && defined(HAVE_FCNTL_H) +#if defined(MSWIN) && defined(HAVE_FCNTL_H) # undef HAVE_FCNTL_H #endif @@ -127,7 +127,7 @@ struct PyMethodDef { Py_ssize_t a; }; # define HINSTANCE long_u /* for generating prototypes */ # endif -# ifndef WIN3264 +# ifndef MSWIN # include # define FARPROC void* # define HINSTANCE void* diff --git a/src/if_python3.c b/src/if_python3.c index 4bbbdd1963..8b4bee9f75 100644 --- a/src/if_python3.c +++ b/src/if_python3.c @@ -34,7 +34,7 @@ #include -#if defined(_WIN32) && defined(HAVE_FCNTL_H) +#if defined(MSWIN) && defined(HAVE_FCNTL_H) # undef HAVE_FCNTL_H #endif @@ -112,7 +112,7 @@ typedef PySliceObject PySliceObject_T; #if defined(DYNAMIC_PYTHON3) || defined(PROTO) -# ifndef WIN3264 +# ifndef MSWIN # include # define FARPROC void* # define HINSTANCE void* diff --git a/src/if_ruby.c b/src/if_ruby.c index 24814a2326..85f94c4f09 100644 --- a/src/if_ruby.c +++ b/src/if_ruby.c @@ -64,7 +64,7 @@ # define RUBY_EXPORT # endif -#if !(defined(WIN32) || defined(_WIN64)) +#if !defined(MSWIN) # include # define HINSTANCE void* # define RUBY_PROC void* @@ -331,7 +331,7 @@ static void ruby_vim_init(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 @@ -447,7 +447,7 @@ static VALUE *dll_ruby_errinfo; # 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 @@ -666,7 +666,7 @@ static struct # 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 @@ -949,7 +949,7 @@ static int ensure_ruby_initialized(void) if (ruby_enabled(TRUE)) { #endif -#ifdef _WIN32 +#ifdef MSWIN /* suggested by Ariya Mizutani */ int argc = 1; char *argv[] = {"gvim.exe"}; di