]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.1081: has('bsd') is true for GNU/Hurd v9.1.1081
authorZhaoming Luo <zhmingluo@163.com>
Thu, 6 Feb 2025 20:39:35 +0000 (21:39 +0100)
committerChristian Brabandt <cb@256bit.org>
Thu, 6 Feb 2025 20:39:35 +0000 (21:39 +0100)
Problem:  has('bsd') is true for GNU/Hurd
Solution: exclude GNU/Hurd from BSD feature flag
          (Zhaoming Luo)

GNU/Hurd, like Mac OS X, is a BSD-based system. It should exclude
has('bsd') feature just like what Mac OS X does. The __GNU__ pre-defined
macro indicates it's compiled for GNU/Hurd.

closes: #16580

Signed-off-by: Zhaoming Luo <zhmingluo@163.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/doc/builtin.txt
src/evalfunc.c
src/testdir/test_functions.vim
src/version.c

index 39ff14e5f3a7d661c71360fb669ff9cd362a8103..e2d2f43b5ef3dc6c4016bbc03212102b82e72e5c 100644 (file)
@@ -1,4 +1,4 @@
-*builtin.txt*  For Vim version 9.1.  Last change: 2025 Feb 02
+*builtin.txt*  For Vim version 9.1.  Last change: 2025 Feb 06
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -12750,6 +12750,7 @@ gui_win32s              idem, and Win32s system being used (Windows 3.1)
 haiku                  Haiku version of Vim.
 hangul_input           Compiled with Hangul input support. |hangul|
 hpux                   HP-UX version of Vim.
+hurd                   GNU/Hurd version of Vim
 iconv                  Can use iconv() for conversion.
 insert_expand          Compiled with support for CTRL-X expansion commands in
                        Insert mode. (always true)
index 69b6a4fa89896a63df7741faa878d74cefe96894..559247108111389c369c9b16ce28fc0c74292f2d 100644 (file)
@@ -6425,7 +6425,7 @@ f_has(typval_T *argvars, typval_T *rettv)
 #endif
                },
        {"bsd",
-#if defined(BSD) && !defined(MACOS_X)
+#if defined(BSD) && !defined(MACOS_X) && !defined(__GNU__)
                1
 #else
                0
@@ -6436,6 +6436,13 @@ f_has(typval_T *argvars, typval_T *rettv)
                1
 #else
                0
+#endif
+               },
+       {"hurd",
+#ifdef __GNU__
+               1
+#else
+               0
 #endif
                },
        {"linux",
index 5783c7a8e3b8846969fd5e548ba5c74947f20c07..8ecc3a67106fc01199e0c0f83ab46c5e7cea307c 100644 (file)
@@ -2888,6 +2888,7 @@ func Test_platform_name()
   " Is Unix?
   call assert_equal(has('bsd'), has('bsd') && has('unix'))
   call assert_equal(has('hpux'), has('hpux') && has('unix'))
+  call assert_equal(has('hurd'), has('hurd') && has('unix'))
   call assert_equal(has('linux'), has('linux') && has('unix'))
   call assert_equal(has('mac'), has('mac') && has('unix'))
   call assert_equal(has('qnx'), has('qnx') && has('unix'))
@@ -2905,6 +2906,7 @@ func Test_platform_name()
     call assert_equal(uname =~? 'QNX', has('qnx'))
     call assert_equal(uname =~? 'SunOS', has('sun'))
     call assert_equal(uname =~? 'CYGWIN\|MSYS', has('win32unix'))
+    call assert_equal(uname =~? 'GNU', has('hurd'))
   endif
 endfunc
 
index d8e8c0ea6f5dd64fe4195d3fbfebfd9383a25832..55cbd4fdaf8310014b589fb3fd5d10765566fc72 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1081,
 /**/
     1080,
 /**/