diff options
-rw-r--r-- | runtime/doc/eval.txt | 7 | ||||
-rw-r--r-- | runtime/doc/os_mac.txt | 5 | ||||
-rwxr-xr-x | src/auto/configure | 79 | ||||
-rw-r--r-- | src/config.h.in | 1 | ||||
-rw-r--r-- | src/configure.ac | 86 | ||||
-rw-r--r-- | src/digraph.c | 4 | ||||
-rw-r--r-- | src/edit.c | 4 | ||||
-rw-r--r-- | src/evalfunc.c | 17 | ||||
-rw-r--r-- | src/feature.h | 8 | ||||
-rw-r--r-- | src/fileio.c | 38 | ||||
-rw-r--r-- | src/getchar.c | 11 | ||||
-rw-r--r-- | src/globals.h | 6 | ||||
-rw-r--r-- | src/gui.c | 4 | ||||
-rw-r--r-- | src/gui_mac.c | 4 | ||||
-rw-r--r-- | src/if_python.c | 20 | ||||
-rw-r--r-- | src/if_python3.c | 21 | ||||
-rw-r--r-- | src/if_ruby.c | 14 | ||||
-rw-r--r-- | src/keymap.h | 2 | ||||
-rw-r--r-- | src/macros.h | 11 | ||||
-rw-r--r-- | src/main.c | 15 | ||||
-rw-r--r-- | src/mbyte.c | 26 | ||||
-rw-r--r-- | src/message.c | 7 | ||||
-rw-r--r-- | src/misc1.c | 11 | ||||
-rw-r--r-- | src/misc2.c | 21 | ||||
-rw-r--r-- | src/option.c | 11 | ||||
-rw-r--r-- | src/os_mac.h | 90 | ||||
-rw-r--r-- | src/os_macosx.m | 8 | ||||
-rw-r--r-- | src/os_unix.c | 11 | ||||
-rw-r--r-- | src/proto.h | 4 | ||||
-rw-r--r-- | src/pty.c | 8 | ||||
-rw-r--r-- | src/structs.h | 15 | ||||
-rw-r--r-- | src/term.c | 4 | ||||
-rw-r--r-- | src/termlib.c | 2 | ||||
-rw-r--r-- | src/ui.c | 4 | ||||
-rw-r--r-- | src/undo.c | 2 | ||||
-rw-r--r-- | src/version.c | 19 | ||||
-rw-r--r-- | src/vim.h | 49 | ||||
-rw-r--r-- | src/window.c | 2 |
38 files changed, 268 insertions, 383 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 759ad16fc4..6dc05a5568 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -8877,9 +8877,8 @@ 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. -macunix Compiled for OS X, with |mac-darwin-feature| -osx Compiled for OS X, with or w/o |mac-darwin-feature| +mac Any Macintosh version of Vim cf. osx +macunix Synonym for osxdarwin menu Compiled with support for |:menu|. mksession Compiled with support for |:mksession|. modify_fname Compiled with file name modifiers. |filename-modifiers| @@ -8902,6 +8901,8 @@ netbeans_enabled Compiled with support for |netbeans| and connected. netbeans_intg Compiled with support for |netbeans|. num64 Compiled with 64-bit |Number| support. ole Compiled with OLE automation support for Win32. +osx Compiled for macOS cf. mac +osxdarwin Compiled for macOS, with |mac-darwin-feature| packages Compiled with |packages| support. path_extra Compiled with up/downwards search in 'path' and 'tags' perl Compiled with Perl interface. diff --git a/runtime/doc/os_mac.txt b/runtime/doc/os_mac.txt index cff87dec24..2a2b07a7a9 100644 --- a/runtime/doc/os_mac.txt +++ b/runtime/doc/os_mac.txt @@ -164,8 +164,9 @@ If you want to disable it, pass `--disable-darwin` to the configure script: > and then run `make` to build Vim. The order of the options doesn't matter. To make sure at runtime whether or not the darwin feature is compiled in, you -can use `has('macunix')` which returns 1 if the feature is compiled in; 0 -otherwise. +can use `has('osxdarwin')` which returns 1 if the feature is compiled in; 0 +otherwise. For backwards comptibility, you can still use `macunix` instead of +`osxdarwin`. Notable use cases where `--disable-darwin` is turned out to be useful are: diff --git a/src/auto/configure b/src/auto/configure index fa9276a136..467f9dcf4c 100755 --- a/src/auto/configure +++ b/src/auto/configure @@ -4187,6 +4187,8 @@ $as_echo_n "checking for Darwin (Mac OS X)... " >&6; } if test "`(uname) 2>/dev/null`" = Darwin; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } + MACOS_X=yes + CPPFLAGS="$CPPFLAGS -DMACOS_X" { $as_echo "$as_me:${as_lineno-$LINENO}: checking --disable-darwin argument" >&5 $as_echo_n "checking --disable-darwin argument... " >&6; } @@ -4357,10 +4359,10 @@ rm -f core conftest.err conftest.$ac_objext \ fi if test "$enable_darwin" = "yes"; then - MACOSX=yes + MACOS_X_DARWIN=yes OS_EXTRA_SRC="os_macosx.m os_mac_conv.c"; OS_EXTRA_OBJ="objects/os_macosx.o objects/os_mac_conv.o" - CPPFLAGS="$CPPFLAGS -DMACOS_X_UNIX" + CPPFLAGS="$CPPFLAGS -DMACOS_X_DARWIN" # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ @@ -5153,7 +5155,7 @@ rm -f core conftest.err conftest.$ac_objext \ if test -f "${vi_cv_path_lua_pfx}/bin/cyglua-${vi_cv_version_lua}.dll"; then vi_cv_dll_name_lua="cyglua-${vi_cv_version_lua}.dll" else - if test "x$MACOSX" = "xyes"; then + if test "x$MACOS_X" = "xyes"; then ext="dylib" indexes="" else @@ -5199,7 +5201,7 @@ $as_echo "yes" >&6; } LUA_CFLAGS="-DDYNAMIC_LUA_DLL=\\\"${vi_cv_dll_name_lua}\\\" $LUA_CFLAGS" fi if test "X$LUA_CFLAGS$LUA_LIBS" != "X" && \ - test "x$MACOSX" = "xyes" && test "x$vi_cv_with_luajit" != "xno" && \ + test "x$MACOS_X" = "xyes" && test "x$vi_cv_with_luajit" != "xno" && \ test "`(uname -m) 2>/dev/null`" = "x86_64"; then LUA_LIBS="-pagezero_size 10000 -image_base 100000000 $LUA_LIBS" fi @@ -5404,7 +5406,7 @@ $as_echo "not found" >&6; } for path in "${vi_cv_path_mzscheme_pfx}/lib" "${SCHEME_LIB}"; do if test "X$path" != "X"; then - if test "x$MACOSX" = "xyes"; then + if test "x$MACOS_X" = "xyes"; then MZSCHEME_LIBS="-framework Racket" MZSCHEME_CFLAGS="-DMZ_PRECISE_GC" elif test -f "${path}/libmzscheme3m.a"; then @@ -5784,7 +5786,7 @@ $as_echo ">>> too old; need Perl version 5.003_01 or later <<<" >&6; } fi fi - if test "x$MACOSX" = "xyes"; then + if test "x$MACOS_X" = "xyes"; then dir=/System/Library/Perl darwindir=$dir/darwin if test -d $darwindir; then @@ -6002,7 +6004,7 @@ __: eof eval "`cd ${PYTHON_CONFDIR} && make -f "${tmp_mkf}" __ | sed '/ directory /d'`" rm -f -- "${tmp_mkf}" - if test "x$MACOSX" = "xyes" && test -n "${python_PYTHONFRAMEWORK}" && ${vi_cv_path_python} -c \ + if test "x$MACOS_X" = "xyes" && test -n "${python_PYTHONFRAMEWORK}" && ${vi_cv_path_python} -c \ "import sys; sys.exit(${vi_cv_var_python_version} < 2.3)"; then vi_cv_path_python_plibs="-framework Python" if test "x${vi_cv_path_python}" != "x/usr/bin/python" && test -n "${python_PYTHONFRAMEWORKPREFIX}"; then @@ -6965,7 +6967,7 @@ $as_echo "$tclver - OK" >&6; }; { $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of Tcl include" >&5 $as_echo_n "checking for location of Tcl include... " >&6; } - if test "x$MACOSX" != "xyes"; then + if test "x$MACOS_X" != "xyes"; then tclinc="$tclloc/include $tclloc/include/tcl $tclloc/include/tcl$tclver /usr/local/include /usr/local/include/tcl$tclver /usr/include /usr/include/tcl$tclver" else tclinc="/System/Library/Frameworks/Tcl.framework/Headers" @@ -6987,7 +6989,7 @@ $as_echo "<not found>" >&6; } if test -z "$SKIP_TCL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of tclConfig.sh script" >&5 $as_echo_n "checking for location of tclConfig.sh script... " >&6; } - if test "x$MACOSX" != "xyes"; then + if test "x$MACOS_X" != "xyes"; then tclcnf=`echo $tclinc | sed s/include/lib/g` tclcnf="$tclcnf `echo $tclinc | sed s/include/lib64/g`" else @@ -7567,7 +7569,7 @@ fi $as_echo "$enable_fontset" >&6; } test -z "$with_x" && with_x=yes -test "${enable_gui-yes}" != no -a "x$MACOSX" != "xyes" -a "x$QNX" != "xyes" && with_x=yes +test "${enable_gui-yes}" != no -a "x$MACOS_X" != "xyes" -a "x$QNX" != "xyes" && with_x=yes if test "$with_x" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: defaulting to: don't HAVE_X11" >&5 $as_echo "defaulting to: don't HAVE_X11" >&6; } @@ -8584,7 +8586,7 @@ $as_echo "$ac_cv_small_wchar_t" >&6; } fi fi -test "x$with_x" = xno -a "x$MACOSX" != "xyes" -a "x$QNX" != "xyes" && enable_gui=no +test "x$with_x" = xno -a "x$MACOS_X" != "xyes" -a "x$QNX" != "xyes" && enable_gui=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-gui argument" >&5 $as_echo_n "checking --enable-gui argument... " >&6; } @@ -8626,7 +8628,7 @@ $as_echo "Sorry, $enable_gui GUI is not supported" >&6; } SKIP_PHOTON=YES ;; esac -elif test "x$MACOSX" = "xyes" -a "x$with_x" = "xno" ; then +elif test "x$MACOS_X" = "xyes" -a "x$with_x" = "xno" ; then SKIP_CARBON= case "$enable_gui_canon" in no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no GUI support" >&5 @@ -8804,7 +8806,7 @@ $as_echo "$enable_carbon_check" >&6; }; fi -if test "x$MACOSX" = "xyes" -a -z "$SKIP_CARBON" -a "x$CARBON" = "xyes"; then +if test "x$MACOS_X" = "xyes" -a -z "$SKIP_CARBON" -a "x$CARBON" = "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Carbon GUI" >&5 $as_echo_n "checking for Carbon GUI... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 @@ -10624,7 +10626,7 @@ fi done -if test "x$MACOSX" = "xyes"; then +if test "x$MACOS_X" = "xyes"; then $as_echo "#define NO_STRINGS_WITH_STRING_H 1" >>confdefs.h else @@ -12076,7 +12078,7 @@ for ac_func in fchdir fchown fsync getcwd getpseudotty \ getpgid setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \ sigprocmask sigvec strcasecmp strerror strftime stricmp strncasecmp \ strnicmp strpbrk strtol tgetent towlower towupper iswupper \ - usleep utime utimes + usleep utime utimes mblen do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" @@ -14099,28 +14101,51 @@ fi done -if test "x$MACOSX" = "xyes" -a -n "$PERL"; then +if test "x$MACOS_X" = "xyes" -a -n "$PERL"; then if echo $LIBS | grep -e '-ldl' >/dev/null; then LIBS=`echo $LIBS | sed s/-ldl//` PERL_LIBS="$PERL_LIBS -ldl" fi fi -if test "x$MACOSX" = "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we need -framework Cocoa" >&5 -$as_echo_n "checking whether we need -framework Cocoa... " >&6; } - if test "x$features" != "xtiny" || test "x$enable_multibyte" = "xyes"; then - LIBS=$"$LIBS -framework Cocoa" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if test "$MACOS_X" = "yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we need macOS frameworks" >&5 +$as_echo_n "checking whether we need macOS frameworks... " >&6; } + if test "$GUITYPE" = "CARBONGUI"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, we need Carbon" >&5 +$as_echo "yes, we need Carbon" >&6; } + LIBS="$LIBS -framework Carbon" + elif test "$MACOS_X_DARWIN" = "yes"; then + if test "$features" = "tiny"; then + OS_EXTRA_SRC=`echo "$OS_EXTRA_SRC" | sed -e 's+os_macosx.m++'` + OS_EXTRA_OBJ=`echo "$OS_EXTRA_OBJ" | sed -e 's+objects/os_macosx.o++'` + if test "$enable_multibyte" = "yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, we need CoreServices" >&5 +$as_echo "yes, we need CoreServices" >&6; } + LIBS="$LIBS -framework CoreServices" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + OS_EXTRA_SRC=`echo "$OS_EXTRA_SRC" | sed -e 's+os_mac_conv.c++'` + OS_EXTRA_OBJ=`echo "$OS_EXTRA_OBJ" | sed -e 's+objects/os_mac_conv.o++'` + CPPFLAGS=`echo "$CPPFLAGS" | sed -e 's+-DMACOS_X_DARWIN++'` + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, we need AppKit" >&5 +$as_echo "yes, we need AppKit" >&6; } + LIBS="$LIBS -framework AppKit" + if test "$features" = "small" -a "$enable_multibyte" = "no"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: +multi_byte will be set in favor of +clipboard" >&5 +$as_echo "$as_me: +multi_byte will be set in favor of +clipboard" >&6;} + enable_multibyte=yes + $as_echo "#define FEAT_MBYTE 1" >>confdefs.h + + fi + fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x$features" = "xtiny"; then - OS_EXTRA_SRC=`echo "$OS_EXTRA_SRC" | sed -e 's+os_macosx.m++'` - OS_EXTRA_OBJ=`echo "$OS_EXTRA_OBJ" | sed -e 's+objects/os_macosx.o++'` - fi fi if test "x$MACARCH" = "xboth" && test "x$GUITYPE" = "xCARBONGUI"; then LDFLAGS="$LDFLAGS -isysroot $DEVELOPER_DIR/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc" diff --git a/src/config.h.in b/src/config.h.in index fe68d49b14..e692d40ac5 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -212,6 +212,7 @@ #undef HAVE_USLEEP #undef HAVE_UTIME #undef HAVE_BIND_TEXTDOMAIN_CODESET +#undef HAVE_MBLEN /* Define, if needed, for accessing large files. */ #undef _LARGE_FILES diff --git a/src/configure.ac b/src/configure.ac index 2185c9e889..f4c01943db 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -134,6 +134,8 @@ dnl are a lot of other things we need to change besides GUI stuff AC_MSG_CHECKING([for Darwin (Mac OS X)]) if test "`(uname) 2>/dev/null`" = Darwin; then AC_MSG_RESULT(yes) + MACOS_X=yes + CPPFLAGS="$CPPFLAGS -DMACOS_X" AC_MSG_CHECKING(--disable-darwin argument) AC_ARG_ENABLE(darwin, @@ -208,12 +210,12 @@ if test "`(uname) 2>/dev/null`" = Darwin; then fi if test "$enable_darwin" = "yes"; then - MACOSX=yes + MACOS_X_DARWIN=yes OS_EXTRA_SRC="os_macosx.m os_mac_conv.c"; OS_EXTRA_OBJ="objects/os_macosx.o objects/os_mac_conv.o" dnl TODO: use -arch i386 on Intel machines dnl Removed -no-cpp-precomp, only for very old compilers. - CPPFLAGS="$CPPFLAGS -DMACOS_X_UNIX" + CPPFLAGS="$CPPFLAGS -DMACOS_X_DARWIN" dnl If Carbon is found, assume we don't want X11 dnl unless it was specifically asked for (--with-x) @@ -626,7 +628,7 @@ if test "$enable_luainterp" = "yes" -o "$enable_luainterp" = "dynamic"; then if test -f "${vi_cv_path_lua_pfx}/bin/cyglua-${vi_cv_version_lua}.dll"; then vi_cv_dll_name_lua="cyglua-${vi_cv_version_lua}.dll" else - if test "x$MACOSX" = "xyes"; then + if test "x$MACOS_X" = "xyes"; then ext="dylib" indexes="" else @@ -670,7 +672,7 @@ if test "$enable_luainterp" = "yes" -o "$enable_luainterp" = "dynamic"; then LUA_CFLAGS="-DDYNAMIC_LUA_DLL=\\\"${vi_cv_dll_name_lua}\\\" $LUA_CFLAGS" fi if test "X$LUA_CFLAGS$LUA_LIBS" != "X" && \ - test "x$MACOSX" = "xyes" && test "x$vi_cv_with_luajit" != "xno" && \ + test "x$MACOS_X" = "xyes" && test "x$vi_cv_with_luajit" != "xno" && \ test "`(uname -m) 2>/dev/null`" = "x86_64"; then dnl OSX/x64 requires these flags. See http://luajit.org/install.html LUA_LIBS="-pagezero_size 10000 -image_base 100000000 $LUA_LIBS" @@ -802,7 +804,7 @@ if test "$enable_mzschemeinterp" = "yes"; then for path in "${vi_cv_path_mzscheme_pfx}/lib" "${SCHEME_LIB}"; do if test "X$path" != "X"; then - if test "x$MACOSX" = "xyes"; then + if test "x$MACOS_X" = "xyes"; then MZSCHEME_LIBS="-framework Racket" MZSCHEME_CFLAGS="-DMZ_PRECISE_GC" elif test -f "${path}/libmzscheme3m.a"; then @@ -1059,7 +1061,7 @@ if test "$enable_perlinterp" = "yes" -o "$enable_perlinterp" = "dynamic"; then fi fi - if test "x$MACOSX" = "xyes"; then + if test "x$MACOS_X" = "xyes"; then dnl Mac OS X 10.2 or later dir=/System/Library/Perl darwindir=$dir/darwin @@ -1201,7 +1203,7 @@ eof dnl -- delete the lines from make about Entering/Leaving directory eval "`cd ${PYTHON_CONFDIR} && make -f "${tmp_mkf}" __ | sed '/ directory /d'`" rm -f -- "${tmp_mkf}" - if test "x$MACOSX" = "xyes" && test -n "${python_PYTHONFRAMEWORK}" && ${vi_cv_path_python} -c \ + if test "x$MACOS_X" = "xyes" && test -n "${python_PYTHONFRAMEWORK}" && ${vi_cv_path_python} -c \ "import sys; sys.exit(${vi_cv_var_python_version} < 2.3)"; then vi_cv_path_python_plibs="-framework Python" if test "x${vi_cv_path_python}" != "x/usr/bin/python" && test -n "${python_PYTHONFRAMEWORKPREFIX}"; then @@ -1269,7 +1271,7 @@ eof AC_MSG_CHECKING([if -pthread should be used]) threadsafe_flag= thread_lib= - dnl if test "x$MACOSX" != "xyes"; then + dnl if test "x$MACOS_X" != "xyes"; then if test "`(uname) 2>/dev/null`" != Darwin; then test "$GCC" = yes && threadsafe_flag="-pthread" if test "`(uname) 2>/dev/null`" = FreeBSD; then @@ -1474,7 +1476,7 @@ eof AC_MSG_CHECKING([if -pthread should be used]) threadsafe_flag= thread_lib= - dnl if test "x$MACOSX" != "xyes"; then + dnl if test "x$MACOS_X" != "xyes"; then if test "`(uname) 2>/dev/null`" != Darwin; then test "$GCC" = yes && threadsafe_flag="-pthread" if test "`(uname) 2>/dev/null`" = FreeBSD; then @@ -1729,7 +1731,7 @@ if test "$enable_tclinterp" = "yes" -o "$enable_tclinterp" = "dynamic"; then tcldll=`echo 'puts libtcl[[info tclversion]][[info sharedlibextension]]' | $vi_cv_path_tcl -` AC_MSG_CHECKING(for location of Tcl include) - if test "x$MACOSX" != "xyes"; then + if test "x$MACOS_X" != "xyes"; then tclinc="$tclloc/include $tclloc/include/tcl $tclloc/include/tcl$tclver /usr/local/include /usr/local/include/tcl$tclver /usr/include /usr/include/tcl$tclver" else dnl For Mac OS X 10.3, use the OS-provided framework location @@ -1749,7 +1751,7 @@ if test "$enable_tclinterp" = "yes" -o "$enable_tclinterp" = "dynamic"; then fi if test -z "$SKIP_TCL"; then AC_MSG_CHECKING(for location of tclConfig.sh script) - if test "x$MACOSX" != "xyes"; then + if test "x$MACOS_X" != "xyes"; then tclcnf=`echo $tclinc | sed s/include/lib/g` tclcnf="$tclcnf `echo $tclinc | sed s/include/lib64/g`" else @@ -2093,7 +2095,7 @@ AC_MSG_RESULT($enable_fontset) dnl defining FEAT_XFONTSET is delayed, so that it can be disabled for no GUI test -z "$with_x" && with_x=yes -test "${enable_gui-yes}" != no -a "x$MACOSX" != "xyes" -a "x$QNX" != "xyes" && with_x=yes +test "${enable_gui-yes}" != no -a "x$MACOS_X" != "xyes" -a "x$QNX" != "xyes" && with_x=yes if test "$with_x" = no; then AC_MSG_RESULT(defaulting to: don't HAVE_X11) else @@ -2224,7 +2226,7 @@ else fi fi -test "x$with_x" = xno -a "x$MACOSX" != "xyes" -a "x$QNX" != "xyes" && enable_gui=no +test "x$with_x" = xno -a "x$MACOS_X" != "xyes" -a "x$QNX" != "xyes" && enable_gui=no AC_MSG_CHECKING(--enable-gui argument) AC_ARG_ENABLE(gui, @@ -2258,7 +2260,7 @@ if test "x$QNX" = "xyes" -a "x$with_x" = "xno" ; then SKIP_PHOTON=YES ;; esac -elif test "x$MACOSX" = "xyes" -a "x$with_x" = "xno" ; then +elif test "x$MACOS_X" = "xyes" -a "x$with_x" = "xno" ; then SKIP_CARBON= case "$enable_gui_canon" in no) AC_MSG_RESULT(no GUI support) @@ -2380,7 +2382,7 @@ if test "x$SKIP_CARBON" != "xYES" -a "$enable_gui_canon" != "carbon"; then fi -if test "x$MACOSX" = "xyes" -a -z "$SKIP_CARBON" -a "x$CARBON" = "xyes"; then +if test "x$MACOS_X" = "xyes" -a -z "$SKIP_CARBON" -a "x$CARBON" = "xyes"; then AC_MSG_CHECKING(for Carbon GUI) dnl already did the check, just give the message AC_MSG_RESULT(yes); @@ -3188,7 +3190,7 @@ AC_TRY_COMPILE([ AC_MSG_RESULT(no)) AC_CHECK_HEADERS(strings.h) -if test "x$MACOSX" = "xyes"; then +if test "x$MACOS_X" = "xyes"; then dnl The strings.h file on OS/X contains a warning and nothing useful. AC_DEFINE(NO_STRINGS_WITH_STRING_H) else @@ -3650,7 +3652,7 @@ AC_CHECK_FUNCS(fchdir fchown fsync getcwd getpseudotty \ getpgid setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \ sigprocmask sigvec strcasecmp strerror strftime stricmp strncasecmp \ strnicmp strpbrk strtol tgetent towlower towupper iswupper \ - usleep utime utimes) + usleep utime utimes mblen) AC_FUNC_FSEEKO dnl define _LARGE_FILES, _FILE_OFFSET_BITS and _LARGEFILE_SOURCE when @@ -4277,7 +4279,7 @@ elif test x${DLL} = xdl.h; then fi AC_CHECK_HEADERS(setjmp.h) -if test "x$MACOSX" = "xyes" -a -n "$PERL"; then +if test "x$MACOS_X" = "xyes" -a -n "$PERL"; then dnl -ldl must come after DynaLoader.a if echo $LIBS | grep -e '-ldl' >/dev/null; then LIBS=`echo $LIBS | sed s/-ldl//` @@ -4285,22 +4287,40 @@ if test "x$MACOSX" = "xyes" -a -n "$PERL"; then fi fi -if test "x$MACOSX" = "xyes"; then - AC_MSG_CHECKING(whether we need -framework Cocoa) - dnl Cocoa is needed with FEAT_CLIPBOARD or FEAT_MBYTE (the former is - dnl disabled during tiny build) - if test "x$features" != "xtiny" || test "x$enable_multibyte" = "xyes"; then - LIBS=$"$LIBS -framework Cocoa" - AC_MSG_RESULT(yes) +if test "$MACOS_X" = "yes"; then + AC_MSG_CHECKING([whether we need macOS frameworks]) + if test "$GUITYPE" = "CARBONGUI"; then + AC_MSG_RESULT([yes, we need Carbon]) + LIBS="$LIBS -framework Carbon" + elif test "$MACOS_X_DARWIN" = "yes"; then + if test "$features" = "tiny"; then + dnl Since no FEAT_CLIPBOARD, no longer need for os_macosx.m. + OS_EXTRA_SRC=`echo "$OS_EXTRA_SRC" | sed -e 's+os_macosx.m++'` + OS_EXTRA_OBJ=`echo "$OS_EXTRA_OBJ" | sed -e 's+objects/os_macosx.o++'` + if test "$enable_multibyte" = "yes"; then + AC_MSG_RESULT([yes, we need CoreServices]) + LIBS="$LIBS -framework CoreServices" + else + dnl Since no FEAT_MBYTE, no longer need for os_mac_conv.c. + AC_MSG_RESULT([no]) + OS_EXTRA_SRC=`echo "$OS_EXTRA_SRC" | sed -e 's+os_mac_conv.c++'` + OS_EXTRA_OBJ=`echo "$OS_EXTRA_OBJ" | sed -e 's+objects/os_mac_conv.o++'` + CPPFLAGS=`echo "$CPPFLAGS" | sed -e 's+-DMACOS_X_DARWIN++'` + fi + else + AC_MSG_RESULT([yes, we need AppKit]) + LIBS="$LIBS -framework AppKit" + if test "$features" = "small" -a "$enable_multibyte" = "no"; then + dnl Since FEAT_CLIPBOARD is to be defined in vim.h for FEAT_SMALL, define + dnl FEAT_MBYTE in order not to compromise the interoperability of the + dnl clipboard. + AC_MSG_NOTICE([+multi_byte will be set in favor of +clipboard]) + enable_multibyte=yes + AC_DEFINE(FEAT_MBYTE) + fi + fi else - AC_MSG_RESULT(no) - fi - dnl As mentioned above, tiny build implies os_macosx.m isn't needed. - dnl Exclude it from OS_EXTRA_SRC so that linker won't complain about - dnl missing Objective-C symbols. - if test "x$features" = "xtiny"; then - OS_EXTRA_SRC=`echo "$OS_EXTRA_SRC" | sed -e 's+os_macosx.m++'` - OS_EXTRA_OBJ=`echo "$OS_EXTRA_OBJ" | sed -e 's+objects/os_macosx.o++'` + AC_MSG_RESULT([no]) fi fi if test "x$MACARCH" = "xboth" && test "x$GUITYPE" = "xCARBONGUI"; then diff --git a/src/digraph.c b/src/digraph.c index 0b78af7451..6b5a5aac25 100644 --- a/src/digraph.c +++ b/src/digraph.c @@ -321,7 +321,7 @@ static digr_T digraphdefault[] = }; # else -# if defined(MACOS) && !defined(FEAT_MBYTE) +# if defined(MACOS_X) && !defined(FEAT_MBYTE) /* * Macintosh digraphs @@ -449,7 +449,7 @@ static digr_T digraphdefault[] = {NUL, NUL, NUL} }; -# else /* !MACOS */ +# else /* !MACOS_X */ # ifdef OLD_DIGRAPHS diff --git a/src/edit.c b/src/edit.c index a179620522..435e1ed812 100644 --- a/src/edit.c +++ b/src/edit.c @@ -5977,7 +5977,7 @@ insert_special( * Only use mod_mask for special keys, to avoid things like <S-Space>, * unless 'allow_modmask' is TRUE. */ -#ifdef MACOS +#ifdef MACOS_X /* Command-key never produces a normal key */ if (mod_mask & MOD_MASK_CMD) allow_modmask = TRUE; @@ -8756,7 +8756,7 @@ ins_start_select(int c) case K_KPAGEUP: case K_PAGEDOWN: case K_KPAGEDOWN: -# ifdef MACOS +# ifdef MACOS_X case K_LEFT: case K_RIGHT: case K_UP: diff --git a/src/evalfunc.c b/src/evalfunc.c index 55d22951aa..2f294ca1ff 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -24,7 +24,7 @@ # include <float.h> #endif -#ifdef MACOS +#ifdef MACOS_X # include <time.h> /* for time_t */ #endif @@ -5539,14 +5539,13 @@ f_has(typval_T *argvars, typval_T *rettv) #ifdef __BEOS__ "beos", #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 */ +#ifdef MACOS_X + "mac", /* Mac OS X (and, once, Mac OS Classic) */ + "osx", /* Mac OS X */ +# ifdef MACOS_X_DARWIN + "macunix", /* Mac OS X, with the darwin feature */ + "osxdarwin", /* synonym for macunix */ +# endif #endif #ifdef __QNX__ "qnx", diff --git a/src/feature.h b/src/feature.h index 37e4d31270..e90d7557b1 100644 --- a/src/feature.h +++ b/src/feature.h @@ -61,10 +61,10 @@ */ #if !defined(FEAT_TINY) && !defined(FEAT_SMALL) && !defined(FEAT_NORMAL) \ && !defined(FEAT_BIG) && !defined(FEAT_HUGE) -# if defined(UNIX) || defined(WIN3264) || defined(MACOS) +# if defined(UNIX) || defined(WIN3264) || defined(MACOS_X) # define FEAT_HUGE # else -# if defined(MSWIN) || defined(VMS) || defined(MACOS) || defined(AMIGA) +# if defined(MSWIN) || defined(VMS) || defined(AMIGA) # define FEAT_BIG # else # define FEAT_NORMAL @@ -363,7 +363,7 @@ */ #ifdef FEAT_NORMAL # define FEAT_EVAL -# if defined(HAVE_FLOAT_FUNCS) || defined(WIN3264) || defined(MACOS) +# if defined(HAVE_FLOAT_FUNCS) || defined(WIN3264) || defined(MACOS_X) # define FEAT_FLOAT # endif # if defined(HAVE_STDINT_H) || defined(WIN3264) || (VIM_SIZEOF_LONG >= 8) @@ -777,7 +777,7 @@ * there is no terminal version, and on Windows we can't figure out how to * fork one off with :gui. */ -#if defined(FEAT_GUI_MSWIN) || (defined(FEAT_GUI_MAC) && !defined(MACOS_X_UNIX)) +#if defined(FEAT_GUI_MSWIN) || (defined(FEAT_GUI_MAC) && !defined(MACOS_X_DARWIN)) # define ALWAYS_USE_GUI #endif diff --git a/src/fileio.c b/src/fileio.c index 82659be07b..87b85cf386 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -68,7 +68,7 @@ static int au_find_group(char_u *name); # define FIO_PUT_CP(x) (((x) & 0xffff) << 16) /* put codepage in top word */ # define FIO_GET_CP(x) (((x)>>16) & 0xffff) /* get codepage from top word */ # endif -# ifdef MACOS_X +# ifdef MACOS_CONVERT # define FIO_MACROMAN 0x20 /* convert MacRoman */ # endif # define FIO_ENDIAN_L 0x80 /* little endian */ @@ -127,7 +127,7 @@ static int make_bom(char_u *buf, char_u *name); # ifdef WIN3264 static int get_win_fio_flags(char_u *ptr); # endif -# ifdef MACOS_X +# ifdef MACOS_CONVERT static int get_mac_fio_flags(char_u *ptr); # endif #endif @@ -1088,7 +1088,7 @@ retry: fio_flags = get_win_fio_flags(fenc); # endif -# ifdef MACOS_X +# ifdef MACOS_CONVERT /* Conversion from Apple MacRoman to latin1 or UTF-8 */ if (fio_flags == 0) fio_flags = get_mac_fio_flags(fenc); @@ -1274,7 +1274,7 @@ retry: else if (fio_flags & FIO_CODEPAGE) size = size / ICONV_MULT; /* also worst case */ # endif -# ifdef MACOS_X +# ifdef MACOS_CONVERT else if (fio_flags & FIO_MACROMAN) size = size / ICONV_MULT; /* also worst case */ # endif @@ -4200,20 +4200,6 @@ buf_write( } } -#ifdef MACOS_CLASSIC /* TODO: Is it need for MACOS_X? (Dany) */ - /* - * Before risking to lose the original file verify if there's - * a resource fork to preserve, and if cannot be done warn - * the users. This happens when overwriting without backups. - */ - if (backup == NULL && overwriting && !append) - if (mch_has_resource_fork(fname)) - { - errmsg = (char_u *)_("E460: The resource fork would be lost (add ! to override)"); - goto restore_backup; - } -#endif - #ifdef VMS vms_remove_version(fname); /* remove version */ #endif @@ -4271,7 +4257,7 @@ buf_write( } # endif -# ifdef MACOS_X +# ifdef MACOS_CONVERT if (converted && wb_flags == 0 && (wb_flags = get_mac_fio_flags(fenc)) != 0) { write_info.bw_conv_buflen = bufsize * 3; @@ -4474,13 +4460,7 @@ restore_backup: } write_info.bw_fd = fd; -#if defined(MACOS_CLASSIC) || defined(WIN3264) - /* TODO: Is it need for MACOS_X? (Dany) */ - /* - * On macintosh copy the original files attributes (i.e. the backup) - * This is done in order to preserve the resource fork and the - * Finder attribute (label, comments, custom icons, file creator) - */ +#if defined(WIN3264) if (backup != NULL && overwriting && !append) { if (backup_copy) @@ -5199,10 +5179,6 @@ nofail: got_int |= prev_got_int; -#ifdef MACOS_CLASSIC /* TODO: Is it need for MACOS_X? (Dany) */ - /* Update machine specific information. */ - mch_post_buffer_write(buf); -#endif return retval; } @@ -5972,7 +5948,7 @@ get_win_fio_flags(char_u *ptr) } #endif -#ifdef MACOS_X +#ifdef MACOS_CONVERT /* * Check "ptr" for a Carbon supported encoding and return the FIO_ flags * needed for the internal conversion to/from utf-8 or latin1. diff --git a/src/getchar.c b/src/getchar.c index ef42d9c8cc..455c013884 100644 --- a/src/getchar.c +++ b/src/getchar.c @@ -1893,7 +1893,7 @@ char_avail(void) int retval; #ifdef FEAT_EVAL |