]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.0368: MS-Windows: Hard to define the Vim Patchlevel with leading zeroes v9.1.0368
authorRestorerZ <restorer@mail2k.ru>
Tue, 23 Apr 2024 18:33:38 +0000 (20:33 +0200)
committerChristian Brabandt <cb@256bit.org>
Tue, 23 Apr 2024 18:33:38 +0000 (20:33 +0200)
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 <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/Make_mvc.mak
src/version.c
src/version.h

index e05518610bd20d897ce8a625d87253797ed8e65d..aec9efaf9aff9b16286b491b9351c530aa8f7d0c 100644 (file)
@@ -187,7 +187,7 @@ MINOR=              1
 !ENDIF
 
 !IF ![$(PS) $(PSFLAGS) try{Out-File -FilePath '.\patchlvl.tmp' -InputObject \
-       \"PATCHLEVEL=$$(((Get-Content -Path '.\version.c' \
+       \"PATCHLEVEL=$$([decimal^]((Get-Content -Path '.\version.c' \
        -TotalCount ((Select-String -Pattern 'static int included_patches' \
        -Path '.\version.c').LineNumber+3))[-1^]).Trim().TrimEnd(','))\"} \
        catch{exit 1}]
index fc3969164af3cd8d7cff6cdc9521ff1fc48ac40b..feed8385e57d2554fd1a7e71f6b3bdb1efeaed8e 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    368,
 /**/
     367,
 /**/
index b9c6d837fedcafe1daaab636c42c2a70c8b5635e..13f3bac9ff352919f1cdcc3e14d7ca75372c07aa 100644 (file)
 #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