2020#endif
2121
2222/* Note: when making changes here also adjust configure.ac. */
23- #ifdef WIN32
23+ #ifdef MSWIN
2424/* WinSock API is separated from C API, thus we can't use read(), write(),
2525 * errno... */
2626# define SOCK_ERRNO errno = WSAGetLastError()
@@ -65,7 +65,7 @@ static int safe_to_invoke_callback = 0;
6565
6666static char * part_names [] = {"sock" , "out" , "err" , "in" };
6767
68- #ifdef WIN32
68+ #ifdef MSWIN
6969 static int
7070fd_read (sock_T fd , char * buf , size_t len )
7171{
@@ -234,7 +234,7 @@ ch_error(channel_T *ch, const char *fmt, ...)
234234 }
235235}
236236
237- #ifdef _WIN32
237+ #ifdef MSWIN
238238# undef PERROR
239239# define PERROR (msg ) (void)semsg("%s: %s", msg, strerror_win32(errno))
240240
@@ -687,7 +687,7 @@ channel_open(
687687 int sd = -1 ;
688688 struct sockaddr_in server ;
689689 struct hostent * host ;
690- #ifdef WIN32
690+ #ifdef MSWIN
691691 u_short port = port_in ;
692692 u_long val = 1 ;
693693#else
@@ -696,7 +696,7 @@ channel_open(
696696 channel_T * channel ;
697697 int ret ;
698698
699- #ifdef WIN32
699+ #ifdef MSWIN
700700 channel_init_winsock ();
701701#endif
702702
@@ -758,7 +758,7 @@ channel_open(
758758 {
759759 /* Make connect() non-blocking. */
760760 if (
761- #ifdef _WIN32
761+ #ifdef MSWIN
762762 ioctlsocket (sd , FIONBIO , & val ) < 0
763763#else
764764 fcntl (sd , F_SETFL , O_NONBLOCK ) < 0
@@ -804,14 +804,14 @@ channel_open(
804804
805805 /* If connect() didn't finish then try using select() to wait for the
806806 * connection to be made. For Win32 always use select() to wait. */
807- #ifndef WIN32
807+ #ifndef MSWIN
808808 if (errno != ECONNREFUSED )
809809#endif
810810 {
811811 struct timeval tv ;
812812 fd_set rfds ;
813813 fd_set wfds ;
814- #ifndef WIN32
814+ #ifndef MSWIN
815815 int so_error = 0 ;
816816 socklen_t so_error_len = sizeof (so_error );
817817 struct timeval start_tv ;
@@ -824,7 +824,7 @@ channel_open(
824824
825825 tv .tv_sec = waitnow / 1000 ;
826826 tv .tv_usec = (waitnow % 1000 ) * 1000 ;
827- #ifndef WIN32
827+ #ifndef MSWIN
828828 gettimeofday (& start_tv , NULL );
829829#endif
830830 ch_log (channel ,
@@ -842,7 +842,7 @@ channel_open(
842842 return NULL ;
843843 }
844844
845- #ifdef WIN32
845+ #ifdef MSWIN
846846 /* On Win32: select() is expected to work and wait for up to
847847 * "waitnow" msec for the socket to be open. */
848848 if (FD_ISSET (sd , & wfds ))
@@ -893,7 +893,7 @@ channel_open(
893893#endif
894894 }
895895
896- #ifndef WIN32
896+ #ifndef MSWIN
897897 if (waittime > 1 && elapsed_msec < waittime )
898898 {
899899 /* The port isn't ready but we also didn't get an error.
@@ -930,7 +930,7 @@ channel_open(
930930
931931 if (waittime >= 0 )
932932 {
933- #ifdef _WIN32
933+ #ifdef MSWIN
934934 val = 0 ;
935935 ioctlsocket (sd , FIONBIO , & val );
936936#else
@@ -1029,7 +1029,7 @@ ch_close_part(channel_T *channel, ch_part_T part)
10291029 && (part == PART_OUT || channel -> CH_OUT_FD != * fd )
10301030 && (part == PART_ERR || channel -> CH_ERR_FD != * fd ))
10311031 {
1032- #ifdef WIN32
1032+ #ifdef MSWIN
10331033 if (channel -> ch_named_pipe )
10341034 DisconnectNamedPipe ((HANDLE )fd );
10351035#endif
@@ -1427,7 +1427,7 @@ can_write_buf_line(channel_T *channel)
14271427 in_part -> ch_block_write = 1 ;
14281428
14291429 /* TODO: Win32 implementation, probably using WaitForMultipleObjects() */
1430- #ifndef WIN32
1430+ #ifndef MSWIN
14311431 {
14321432# if defined(HAVE_SELECT )
14331433 struct timeval tval ;
@@ -1759,7 +1759,7 @@ channel_get_all(channel_T *channel, ch_part_T part, int *outlen)
17591759 {
17601760 if (* p == NUL )
17611761 * p = NL ;
1762- #ifdef WIN32
1762+ #ifdef MSWIN
17631763 else if (* p == 0x1b )
17641764 {
17651765 // crush the escape sequence OSC 0/1/2: ESC ]0;
@@ -2064,7 +2064,7 @@ channel_parse_json(channel_T *channel, ch_part_T part)
20642064 (int )buflen );
20652065 reader .js_used = 0 ;
20662066 chanpart -> ch_wait_len = buflen ;
2067- #ifdef WIN32
2067+ #ifdef MSWIN
20682068 chanpart -> ch_deadline = GetTickCount () + 100L ;
20692069#else
20702070 gettimeofday (& chanpart -> ch_deadline , NULL );
@@ -2079,7 +2079,7 @@ channel_parse_json(channel_T *channel, ch_part_T part)
20792079 else
20802080 {
20812081 int timeout ;
2082- #ifdef WIN32
2082+ #ifdef MSWIN
20832083 timeout = GetTickCount () > chanpart -> ch_deadline ;
20842084#else
20852085 {
@@ -3198,7 +3198,7 @@ channel_wait(channel_T *channel, sock_T fd, int timeout)
31983198 if (timeout > 0 )
31993199 ch_log (channel , "Waiting for up to %d msec" , timeout );
32003200
3201- # ifdef WIN32
3201+ # ifdef MSWIN
32023202 if (fd != channel -> CH_SOCK_FD )
32033203 {
32043204 DWORD nread ;
@@ -3554,7 +3554,7 @@ channel_read_json_block(
35543554 timeout = timeout_arg ;
35553555 if (chanpart -> ch_wait_len > 0 )
35563556 {
3557- #ifdef WIN32
3557+ #ifdef MSWIN
35583558 timeout = chanpart -> ch_deadline - GetTickCount () + 1 ;
35593559#else
35603560 {
@@ -3680,7 +3680,7 @@ common_channel_read(typval_T *argvars, typval_T *rettv, int raw, int blob)
36803680 free_job_options (& opt );
36813681}
36823682
3683- # if defined(WIN32 ) || defined(FEAT_GUI_X11 ) || defined(FEAT_GUI_GTK ) \
3683+ # if defined(MSWIN ) || defined(FEAT_GUI_X11 ) || defined(FEAT_GUI_GTK ) \
36843684 || defined(PROTO )
36853685/*
36863686 * 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)
37073707}
37083708# endif
37093709
3710- # if defined(WIN32 ) || defined(FEAT_GUI ) || defined(PROTO )
3710+ # if defined(MSWIN ) || defined(FEAT_GUI ) || defined(PROTO )
37113711/*
37123712 * Check the channels for anything that is ready to be read.
37133713 * The data is put in the read queue.
@@ -3772,7 +3772,7 @@ channel_set_nonblock(channel_T *channel, ch_part_T part)
37723772
37733773 if (fd != INVALID_FD )
37743774 {
3775- #ifdef _WIN32
3775+ #ifdef MSWIN
37763776 u_long val = 1 ;
37773777
37783778 ioctlsocket (fd , FIONBIO , & val );
@@ -3853,7 +3853,7 @@ channel_send(
38533853 else
38543854 {
38553855 res = fd_write (fd , (char * )buf , len );
3856- #ifdef WIN32
3856+ #ifdef MSWIN
38573857 if (channel -> ch_named_pipe && res < 0 )
38583858 {
38593859 DisconnectNamedPipe ((HANDLE )fd );
@@ -4213,7 +4213,7 @@ channel_poll_check(int ret_in, void *fds_in)
42134213}
42144214# endif /* UNIX && !HAVE_SELECT */
42154215
4216- # if (!defined(WIN32 ) && defined(HAVE_SELECT )) || defined(PROTO )
4216+ # if (!defined(MSWIN ) && defined(HAVE_SELECT )) || defined(PROTO )
42174217
42184218/*
42194219 * 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)
43134313
43144314 return ret ;
43154315}
4316- # endif /* !WIN32 && HAVE_SELECT */
4316+ # endif /* !MSWIN && HAVE_SELECT */
43174317
43184318/*
43194319 * Execute queued up commands.
@@ -5039,7 +5039,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
50395039 break ;
50405040 opt -> jo_cwd = tv_get_string_buf_chk (item , opt -> jo_cwd_buf );
50415041 if (opt -> jo_cwd == NULL || !mch_isdir (opt -> jo_cwd )
5042- #ifndef WIN32 // Win32 directories don't have the concept of "executable"
5042+ #ifndef MSWIN // Win32 directories don't have the concept of "executable"
50435043 || mch_access ((char * )opt -> jo_cwd , X_OK ) != 0
50445044#endif
50455045 )
@@ -5199,7 +5199,7 @@ job_free_contents(job_T *job)
51995199#ifdef UNIX
52005200 vim_free (job -> jv_termsig );
52015201#endif
5202- #ifdef WIN3264
5202+ #ifdef MSWIN
52035203 vim_free (job -> jv_tty_type );
52045204#endif
52055205 free_callback (job -> jv_exit_cb , job -> jv_exit_partial );
@@ -5971,7 +5971,7 @@ job_info(job_T *job, dict_T *dict)
59715971#ifdef UNIX
59725972 dict_add_string (dict , "termsig" , job -> jv_termsig );
59735973#endif
5974- #ifdef WIN3264
5974+ #ifdef MSWIN
59755975 dict_add_string (dict , "tty_type" , job -> jv_tty_type );
59765976#endif
59775977
0 commit comments