Hi,

The purpose of this patch is to make it easier for devs to write tests
having branch conditions for macOS.

So far, to cover all possible builds for macOS, the correct condition is
"has('mac') || has('osx')". Yet, unfortunately, it has been something easy
to forget.

This issue itself was discussed last May in the context of an argument on
discontinuation of the support for the Carbon GUI, and we reached an
agreement approving the proposed change in feature list items to address
the issue (IIRC).

In conjunction with that, I wrote a document on mac-darwin-ffeature and
sent a patch for that to vim_dev.  While the patch was included, I somehow
forgot to send out a patch for the mentioned change.

Having seen the test included with Patch 8.0.1049 failed with non-darwin
builds, I remembered what I forgot.

Attached is a patch for the proposed change. It is made against HEAD.

Briefly, with the proposed patch, the relevant feature list items will
change from:

mac Any Macintosh version of Vim, but not all OS X.
macunix Compiled for OS X, with |mac-darwin-feature|
osx Compiled for OS X, with or w/o |mac-darwin-feature|

to:

mac Any Macintosh version of Vim
macunix Compiled for OS X, with |mac-darwin-feature|
osx Compiled for OS X, without |mac-darwin-feature|


Best regards,
Kazunobu

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index f9c6ae3b4..6b99bf316 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -8854,9 +8854,9 @@ listcmds          Compiled with commands for the buffer 
list |:files|
                        and the argument list |arglist|.
 localmap               Compiled with local mappings and abbr. |:map-local|
 lua                    Compiled with Lua interface |Lua|.
-mac                    Any Macintosh version of Vim, but not all OS X.
+mac                    Any Macintosh version of Vim
 macunix                        Compiled for OS X, with |mac-darwin-feature|
-osx                    Compiled for OS X, with or w/o |mac-darwin-feature|
+osx                    Compiled for OS X, without |mac-darwin-feature|
 menu                   Compiled with support for |:menu|.
 mksession              Compiled with support for |:mksession|.
 modify_fname           Compiled with file name modifiers. |filename-modifiers|
diff --git a/src/evalfunc.c b/src/evalfunc.c
index 2692de61f..4dc6b3c7d 100644
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -5545,12 +5545,11 @@ f_has(typval_T *argvars, typval_T *rettv)
 #endif
 #ifdef MACOS
        "mac",
-#endif
-#if defined(MACOS_X_UNIX)
-       "macunix",  /* built with 'darwin' enabled */
-#endif
-#if defined(__APPLE__) && __APPLE__ == 1
-       "osx",      /* built with or without 'darwin' enabled */
+# if defined(MACOS_X_UNIX)
+       "macunix",  /* built with mac-darwin-feature */
+# elif !defined(MACOS_CLASSIC)
+       "osx",      /* built without mac-darwin-feature */
+# endif
 #endif
 #ifdef __QNX__
        "qnx",
diff --git a/src/option.c b/src/option.c
index a1304c944..b0a35b00d 100644
--- a/src/option.c
+++ b/src/option.c
@@ -1452,7 +1452,7 @@ static struct vimoption options[] =
     {"guioptions",  "go",   P_STRING|P_VI_DEF|P_RALL|P_FLAGLIST,
 #if defined(FEAT_GUI)
                            (char_u *)&p_go, PV_NONE,
-# if defined(UNIX) && !defined(MACOS)
+# if defined(UNIX) && !defined(FEAT_GUI_MAC)
                            {(char_u *)"aegimrLtT", (char_u *)0L}
 # else
                            {(char_u *)"egmrLtT", (char_u *)0L}
diff --git a/src/testdir/test_normal.vim b/src/testdir/test_normal.vim
index 21d6aa988..155ddbfb3 100644
--- a/src/testdir/test_normal.vim
+++ b/src/testdir/test_normal.vim
@@ -1605,7 +1605,7 @@ fun! Test_normal30_changecase()
 
   " Turkish ASCII turns to multi-byte.  On Mac the Turkish locale is available
   " but toupper()/tolower() don't do the right thing.
-  if !has('mac') && !has('osx')
+  if !has('mac')
     try
       lang tr_TR.UTF-8
       set casemap=
diff --git a/src/version.c b/src/version.c
index 2b30a090f..9814e4fd7 100644
--- a/src/version.c
+++ b/src/version.c
@@ -3034,12 +3034,12 @@ list_version(void)
 #ifdef MACOS
 # ifdef MACOS_X
 #  ifdef MACOS_X_UNIX
-    MSG_PUTS(_("\nMacOS X (unix) version"));
+    MSG_PUTS(_("\nmacOS (unix) version"));
 #  else
-    MSG_PUTS(_("\nMacOS X version"));
+    MSG_PUTS(_("\nmacOS version"));
 #  endif
-#else
-    MSG_PUTS(_("\nMacOS version"));
+# else
+    MSG_PUTS(_("\nMacintosh version"));
 # endif
 #endif
 
diff --git a/src/vim.h b/src/vim.h
index 93dc951fb..03576405c 100644
--- a/src/vim.h
+++ b/src/vim.h
@@ -99,7 +99,8 @@
 #  define UNIX
 # endif
 #endif
-#if defined(MACOS_X) || defined(MACOS_CLASSIC)
+#if defined(MACOS_X) || defined(MACOS_CLASSIC) \
+       || (defined(__APPLE__) && __APPLE__ == 1)
 # define MACOS
 #endif
 #if defined(MACOS_X) && defined(MACOS_CLASSIC)
@@ -301,7 +302,9 @@
 # if defined(__MRC__) || defined(__SC__) /* MPW Compilers */
 #  define HAVE_SETENV
 # endif
-# include "os_mac.h"
+# if defined(MACOS_X) || defined(MACOS_CLASSIC)
+#  include "os_mac.h"
+# endif
 #endif
 
 #ifdef __QNX__

Raspunde prin e-mail lui