]> granicus.if.org Git - vim/commitdiff
patch 8.1.1232: can't build on MS-Windows v8.1.1232
authorBram Moolenaar <Bram@vim.org>
Sun, 28 Apr 2019 20:50:40 +0000 (22:50 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 28 Apr 2019 20:50:40 +0000 (22:50 +0200)
Problem:    Can't build on MS-Windows.
Solution:   Define process_still_running.

src/memline.c
src/os_unix.c
src/os_win32.c
src/proto/os_unix.pro
src/proto/os_win32.pro
src/version.c

index 823666e5adac83f2e1645560b61aa7f2b4468aab..705bc4bcaaa8b2ce6319d270918d57c80f34abd6 100644 (file)
@@ -2027,7 +2027,9 @@ make_percent_swname(char_u *dir, char_u *name)
 }
 #endif
 
-#if (defined(UNIX) || defined(VMS)) && (defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG))
+#if (defined(UNIX) || defined(VMS) || defined(MSWIN)) \
+       && (defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG))
+# define HAVE_PROCESS_STILL_RUNNING
 static int process_still_running;
 #endif
 
@@ -2160,10 +2162,10 @@ swapfile_info(char_u *fname)
                    msg_puts(_("\n        process ID: "));
                    msg_outnum(char_to_long(b0.b0_pid));
 #if defined(UNIX) || defined(MSWIN)
-                   if (mch_process_running((pid_t)char_to_long(b0.b0_pid)))
+                   if (mch_process_running(char_to_long(b0.b0_pid)))
                    {
                        msg_puts(_(" (STILL RUNNING)"));
-# if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
+# ifdef HAVE_PROCESS_STILL_RUNNING
                        process_still_running = TRUE;
 # endif
                    }
@@ -2203,7 +2205,7 @@ swapfile_unchanged(char_u *fname)
     int                    fd;
     struct block0   b0;
     int                    ret = TRUE;
-#ifdef UNIX
+#if defined(UNIX) || defined(MSWIN)
     long           pid;
 #endif
 
@@ -2232,7 +2234,7 @@ swapfile_unchanged(char_u *fname)
 #if defined(UNIX) || defined(MSWIN)
     // process must known and not be running
     pid = char_to_long(b0.b0_pid);
-    if (pid == 0L || mch_process_running((pid_t)pid))
+    if (pid == 0L || mch_process_running(pid))
        ret = FALSE;
 #endif
 
@@ -4825,7 +4827,7 @@ findswapname(
                    }
 #endif
 
-#if (defined(UNIX) || defined(VMS)) && (defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG))
+#ifdef HAVE_PROCESS_STILL_RUNNING
                    process_still_running = FALSE;
 #endif
                    // It's safe to delete the swap file if all these are true:
@@ -4893,13 +4895,13 @@ findswapname(
                                    name == NULL
                                        ?  (char_u *)_("Swap file already exists!")
                                        : name,
-# if defined(UNIX) || defined(VMS)
+# ifdef HAVE_PROCESS_STILL_RUNNING
                                    process_still_running
                                        ? (char_u *)_("&Open Read-Only\n&Edit anyway\n&Recover\n&Quit\n&Abort") :
 # endif
                                        (char_u *)_("&Open Read-Only\n&Edit anyway\n&Recover\n&Delete it\n&Quit\n&Abort"), 1, NULL, FALSE);
 
-# if defined(UNIX) || defined(VMS)
+# ifdef HAVE_PROCESS_STILL_RUNNING
                        if (process_still_running && choice >= 4)
                            choice++;   /* Skip missing "Delete it" button */
 # endif
index cd3b68ed786ae50cbfc5a5941fe54bfe98f63e9f..528089b90fdaa4fe83ea236f88974ad5fb5e2b13 100644 (file)
@@ -2397,7 +2397,7 @@ mch_get_pid(void)
  * return TRUE if process "pid" is still running
  */
     int
-mch_process_running(pid_t pid)
+mch_process_running(long pid)
 {
     // EMX kill() not working correctly, it seems
     return kill(pid, 0) == 0;
index 320431f4db02d0893a0767a237cb3e357d937404..537af4675f6c7d2866826cc719e46ce37883819d 100644 (file)
@@ -2907,7 +2907,7 @@ mch_get_pid(void)
  * return TRUE if process "pid" is still running
  */
     int
-mch_process_running(pid_t pid)
+mch_process_running(long pid)
 {
     HANDLE  hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, 0, (DWORD)pid);
     DWORD   status = 0;
index 4677eb0d9aac9cd1a0c0e1a63bdfc67cfd97cb7a..721c07daac6430409077ba9eb2b046b93a9ffef5 100644 (file)
@@ -27,7 +27,7 @@ int mch_get_user_name(char_u *s, int len);
 int mch_get_uname(uid_t uid, char_u *s, int len);
 void mch_get_host_name(char_u *s, int len);
 long mch_get_pid(void);
-int mch_process_running(pid_t pid);
+int mch_process_running(long pid);
 int mch_dirname(char_u *buf, int len);
 int mch_FullName(char_u *fname, char_u *buf, int len, int force);
 int mch_isFullName(char_u *fname);
index c825c54044a0f3f78c8aa9081b3fd1ade6c08bbd..f25164034753562a0298e9afffd1ba161e3a3dd2 100644 (file)
@@ -19,7 +19,7 @@ void fname_case(char_u *name, int len);
 int mch_get_user_name(char_u *s, int len);
 void mch_get_host_name(char_u *s, int len);
 long mch_get_pid(void);
-int mch_process_running(pid_t pid);
+int mch_process_running(long pid);
 int mch_dirname(char_u *buf, int len);
 long mch_getperm(char_u *name);
 int mch_setperm(char_u *name, long perm);
index 80ee7fbe51246091a70a4038c2f2a373e55fa937..40bcf89aea0a3bba1d22edf4b0db0e88555724cc 100644 (file)
@@ -767,6 +767,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1232,
 /**/
     1231,
 /**/