patch 9.1.0368: MS-Windows: Hard to define the Vim Patchlevel with leading 
zeroes

Commit: 
https://github.com/vim/vim/commit/dc5cd1cac1a8b25b6259f2b0a7a071f7b840e730
Author: RestorerZ <[email protected]>
Date:   Tue Apr 23 20:33:38 2024 +0200

    patch 9.1.0368: MS-Windows: Hard to define the Vim Patchlevel with leading 
zeroes
    
    Problem:  MS-Windows: Hard to define the Vim Patchlevel with leading
              zeroes for the installer
    Solution: re-define VIM_VERSION_PATCHLEVEL_STR with leading zeroes,
              interpret Patchlevel as decimal in Make_mvc.mak
              (RestorerZ)
    
    closes: #14471
    
    Signed-off-by: RestorerZ <[email protected]>
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/src/Make_mvc.mak b/src/Make_mvc.mak
index e05518610..aec9efaf9 100644
--- a/src/Make_mvc.mak
+++ b/src/Make_mvc.mak
@@ -187,7 +187,7 @@ MINOR=              1
 !ENDIF
 
 !IF ![$(PS) $(PSFLAGS) try{Out-File -FilePath '.\patchlvl.tmp' -InputObject \
-       \"PATCHLEVEL=$$(((Get-Content -Path '. ersion.c' \
+       \"PATCHLEVEL=$$([decimal^]((Get-Content -Path '. ersion.c' \
        -TotalCount ((Select-String -Pattern 'static int included_patches' \
        -Path '. ersion.c').LineNumber+3))[-1^]).Trim().TrimEnd(','))\"} \
        catch{exit 1}]
diff --git a/src/version.c b/src/version.c
index fc3969164..feed8385e 100644
--- a/src/version.c
+++ b/src/version.c
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    368,
 /**/
     367,
 /**/
diff --git a/src/version.h b/src/version.h
index b9c6d837f..13f3bac9f 100644
--- a/src/version.h
+++ b/src/version.h
@@ -31,7 +31,22 @@
 #ifndef VIM_VERSION_PATCHLEVEL
 # define VIM_VERSION_PATCHLEVEL                0
 #endif
-#define VIM_VERSION_PATCHLEVEL_STR     VIM_TOSTR(VIM_VERSION_PATCHLEVEL)
+
+// Patchlevel with leading zeros
+// For compatibility with the installer from "vim-win32-installer" and WinGet.
+// For details see https://github.com/vim/vim-win32-installer/pull/277
+// and https://github.com/vim/vim-win32-installer/pull/285
+#if VIM_VERSION_PATCHLEVEL < 10
+#define LEADZERO(x) 000 ## x
+#elif VIM_VERSION_PATCHLEVEL < 100
+#define LEADZERO(x) 00 ## x
+#elif VIM_VERSION_PATCHLEVEL < 1000
+#define LEADZERO(x) 0 ## x
+#else
+#define LEADZERO(x) x
+#endif
+
+#define VIM_VERSION_PATCHLEVEL_STR     
VIM_TOSTR(LEADZERO(VIM_VERSION_PATCHLEVEL))
 // Used by MacOS port; should be one of: development, alpha, beta, final
 #define VIM_VERSION_RELEASE            final
 

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/E1rzL8Y-00AiWG-M4%40256bit.org.

Raspunde prin e-mail lui