diff --git a/.travis.yml b/.travis.yml index e863481d1f..7e990d75a8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,7 +34,7 @@ matrix: - os: osx osx_image: xcode7.3 compiler: clang - env: wxCONFIGURE_FLAGS="--enable-cxx11" wxMAKEFILE_FLAGS="CXXFLAGS=-std=c++11" wxSKIP_SAMPLES=1 + env: wxSKIP_SAMPLES=1 name: wxOSX Xcode 7.3 - os: osx osx_image: xcode9.4 diff --git a/CMakeLists.txt b/CMakeLists.txt index c671fb1c0b..e30d3db934 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,7 +29,7 @@ endif() if(APPLE AND NOT CMAKE_OSX_DEPLOYMENT_TARGET) # If no deployment target has been set default to the minimum supported # OS X version (this has to be set before the first project() call) - set(CMAKE_OSX_DEPLOYMENT_TARGET 10.9 CACHE STRING "OS X Deployment Target") + set(CMAKE_OSX_DEPLOYMENT_TARGET 10.10 CACHE STRING "macOS Deployment Target") endif() include(build/cmake/policies.cmake NO_POLICY_SCOPE) diff --git a/build/cmake/functions.cmake b/build/cmake/functions.cmake index 741358f633..c33dd3946c 100644 --- a/build/cmake/functions.cmake +++ b/build/cmake/functions.cmake @@ -77,14 +77,6 @@ endmacro() function(wx_set_common_target_properties target_name) cmake_parse_arguments(wxCOMMON_TARGET_PROPS "DEFAULT_WARNINGS" "" "" ${ARGN}) - if(APPLE AND CMAKE_OSX_DEPLOYMENT_TARGET VERSION_LESS 10.9 AND wxHAS_CXX11) - if(CMAKE_GENERATOR STREQUAL "Xcode") - set_target_properties(${target_name} PROPERTIES XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY libc++) - else() - target_compile_options(${target_name} PUBLIC "-stdlib=libc++") - target_link_libraries(${target_name} PRIVATE "-stdlib=libc++") - endif() - endif() set_target_properties(${target_name} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${wxOUTPUT_DIR}${wxPLATFORM_LIB_DIR}" ARCHIVE_OUTPUT_DIRECTORY "${wxOUTPUT_DIR}${wxPLATFORM_LIB_DIR}" diff --git a/build/cmake/init.cmake b/build/cmake/init.cmake index 4524bc70e6..d013e92a5a 100644 --- a/build/cmake/init.cmake +++ b/build/cmake/init.cmake @@ -11,11 +11,6 @@ if(DEFINED wxBUILD_CXX_STANDARD AND NOT wxBUILD_CXX_STANDARD STREQUAL COMPILER_DEFAULT) set(CMAKE_CXX_STANDARD ${wxBUILD_CXX_STANDARD}) endif() -if(NOT CMAKE_CXX_STANDARD EQUAL 98) - set(wxHAS_CXX11 TRUE) -else() - set(wxHAS_CXX11 FALSE) -endif() if(MSVC) # Determine MSVC runtime library flag diff --git a/build/cmake/setup.cmake b/build/cmake/setup.cmake index e26af41982..1272e3de49 100644 --- a/build/cmake/setup.cmake +++ b/build/cmake/setup.cmake @@ -23,10 +23,6 @@ include(CheckTypeSize) include(CMakePushCheckState) include(TestBigEndian) -if(APPLE AND CMAKE_OSX_DEPLOYMENT_TARGET VERSION_LESS 10.9 AND wxHAS_CXX11) - set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS} "-stdlib=libc++") -endif() - # Add a definition to setup.h and append it to a list of defines for # for compile checks macro(wx_setup_definition def) @@ -143,7 +139,7 @@ wx_check_c_source_compiles( stdio.h ) #TODO: wxNO_VARIADIC_MACROS -if(wxUSE_STL AND NOT wxHAS_CXX11) +if(wxUSE_STL AND CMAKE_CXX_STANDARD EQUAL 98) wx_check_cxx_source_compiles(" std::vector moo; std::list foo; diff --git a/configure b/configure index 501e726ab3..843fe1bbb5 100755 --- a/configure +++ b/configure @@ -1028,7 +1028,6 @@ infodir docdir oldincludedir includedir -runstatedir localstatedir sharedstatedir sysconfdir @@ -1455,7 +1454,6 @@ datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' -runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -1708,15 +1706,6 @@ do | -silent | --silent | --silen | --sile | --sil) silent=yes ;; - -runstatedir | --runstatedir | --runstatedi | --runstated \ - | --runstate | --runstat | --runsta | --runst | --runs \ - | --run | --ru | --r) - ac_prev=runstatedir ;; - -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ - | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ - | --run=* | --ru=* | --r=*) - runstatedir=$ac_optarg ;; - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1854,7 +1843,7 @@ fi for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir runstatedir + libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -2007,7 +1996,6 @@ Fine tuning of the installation directories: --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -2322,9 +2310,9 @@ Optional Packages: --with-themes=all|list use only the specified comma-separated list of wxUniversal themes --with-gtk[=VERSION] use GTK+, VERSION can be 3 (default), 2, 1 or "any" --with-motif use Motif/Lesstif - --with-osx_cocoa use Mac OS X (Cocoa) - --with-osx_iphone use iPhone OS X port - --with-osx use Mac OS X (default port, Cocoa) + --with-osx_cocoa use macOS (Cocoa) + --with-osx_iphone use iOS + --with-osx use macOS (default port, Cocoa) --with-cocoa same as --with-osx_cocoa --with-iphone same as --with-osx_iphone --with-mac same as --with-osx @@ -2352,8 +2340,8 @@ Optional Packages: --with-liblzma use LZMA compression) --with-zlib use zlib for LZW compression --with-expat enable XML support using expat parser - --with-macosx-sdk=PATH use an OS X SDK at PATH - --with-macosx-version-min=VER build binaries which require at least this OS X version + --with-macosx-sdk=PATH use macOS SDK at PATH + --with-macosx-version-min=VER build binaries requiring at least this macOS version (default and lowest supported: 10.10) --with-cxx=11|14|17 use the given C++ dialect --with-gtk-prefix=PFX Prefix where GTK is installed (optional) --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional) @@ -15164,6 +15152,10 @@ if test "$CXX" = "g++" -a "$GXX" != "yes"; then as_fn_error $? "C++ compiler is needed to build wxWidgets" "$LINENO" 5 fi +if test "$wxUSE_MAC" = 1 -a -z "$wxWITH_CXX"; then + wxWITH_CXX=11 +fi + if test -n "$wxWITH_CXX"; then case "$wxWITH_CXX" in 11) @@ -18650,6 +18642,8 @@ if test "x$wxUSE_MACOSX_SDK" = "xno"; then wxUSE_MACOSX_SDK= elif test "x$wxUSE_MACOSX_SDK" = "xyes"; then wxUSE_MACOSX_SDK="`xcode-select -p`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk" +elif test "x$wxUSE_MACOSX_SDK" != "x"; then + macosx_sdk_specified=yes fi @@ -18699,7 +18693,9 @@ $as_echo "$as_me: WARNING: Could not determine deployment target from SDKSetting wxUSE_MACOSX_VERSION_MIN= fi elif test "x$wxUSE_MACOSX_VERSION_MIN" = "x"; then - wxUSE_MACOSX_VERSION_MIN=10.9 + wxUSE_MACOSX_VERSION_MIN=10.10 +else + macosx_minver_specified=yes fi if test "x$MACOSX_SDK_OPTS" != "x"; then @@ -18723,11 +18719,19 @@ if test "x$wxUSE_MACOSX_VERSION_MIN" != "x"; then retest_macosx_linking=yes fi -if test "$HAVE_CXX11" = "1" ; then - eval "CXX=\"$CXX -stdlib=libc++\"" -fi - if test "x$retest_macosx_linking" = "xyes"; then + if test "x$macosx_sdk_specified" = "xyes"; then + error_message="try using --with-macosx-sdk with a different SDK or \ +omitting it entirely to use the default one." + elif test "x$macosx_minver_specified" = "xyes"; then + error_message="try using --with-macosx-version-min with a different OS \ +version or omitting it entirely." + else + error_message="check that command line tools from Xcode 7.2.1 or later are installed." + fi + + error_message="building C++ programs doesn't work, $error_message" + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -18753,8 +18757,8 @@ $as_echo "yes" >&6; } else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "no. Try a different SDK -See \`config.log' for more details" "$LINENO" 5; }; exit 1 +as_fn_error $? "$error_message +See \`config.log' for more details" "$LINENO" 5; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext @@ -18776,10 +18780,23 @@ $as_echo_n "checking if C++ compiler ($CXX) works with SDK/version options... " cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + #include + int main () { + #if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) + #if __MAC_OS_X_VERSION_MIN_REQUIRED < 101000 + #error macOS versions < 10.10 are not supported. + #endif + #if __MAC_OS_X_VERSION_MAX_ALLOWED < 101100 + #error macOS SDK version is too low, 10.11 or later is required. + #endif + #elif !defined(__IPHONE_OS_VERSION_MIN_REQUIRED) + #error unrecognized platform + #endif + ; return 0; } @@ -18790,8 +18807,9 @@ $as_echo "yes" >&6; } else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "no. Try a different SDK -See \`config.log' for more details" "$LINENO" 5; }; exit 1 +as_fn_error $? "$error_message +See \`config.log' for more details" "$LINENO" 5; } + fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext diff --git a/configure.in b/configure.in index 196b3b61d9..620c99ba3a 100644 --- a/configure.in +++ b/configure.in @@ -81,7 +81,7 @@ USE_MAC=0 dnl Unix kind USE_AIX= USE_BSD= dnl any BSD -USE_DARWIN= dnl a.k.a. Mac OS X +USE_DARWIN= dnl a.k.a. macOS USE_FREEBSD= USE_GNU= dnl GNU/Hurd USE_HPUX= @@ -429,9 +429,9 @@ dnl we use AC_ARG_WITH and not WX_ARG_WITH for the toolkit options as they dnl shouldn't default to wxUSE_ALL_FEATURES AC_ARG_WITH(gtk, [[ --with-gtk[=VERSION] use GTK+, VERSION can be 3 (default), 2, 1 or "any"]], [wxUSE_GTK="$withval" CACHE_GTK=1 TOOLKIT_GIVEN=1]) WX_ARG_ONLY_WITH(motif, [ --with-motif use Motif/Lesstif], [wxUSE_MOTIF="$withval" CACHE_MOTIF=1 TOOLKIT_GIVEN=1]) -WX_ARG_ONLY_WITH(osx_cocoa, [ --with-osx_cocoa use Mac OS X (Cocoa)], [wxUSE_OSX_COCOA="$withval" CACHE_OSX_COCOA=1 TOOLKIT_GIVEN=1]) -WX_ARG_ONLY_WITH(osx_iphone, [ --with-osx_iphone use iPhone OS X port], [wxUSE_OSX_IPHONE="$withval" CACHE_OSX_IPHONE=1 TOOLKIT_GIVEN=1]) -WX_ARG_ONLY_WITH(osx, [ --with-osx use Mac OS X (default port, Cocoa)], [wxUSE_OSX_COCOA="$withval" CACHE_OSX_COCOA=1 TOOLKIT_GIVEN=1]) +WX_ARG_ONLY_WITH(osx_cocoa, [ --with-osx_cocoa use macOS (Cocoa)], [wxUSE_OSX_COCOA="$withval" CACHE_OSX_COCOA=1 TOOLKIT_GIVEN=1]) +WX_ARG_ONLY_WITH(osx_iphone, [ --with-osx_iphone use iOS], [wxUSE_OSX_IPHONE="$withval" CACHE_OSX_IPHONE=1 TOOLKIT_GIVEN=1]) +WX_ARG_ONLY_WITH(osx, [ --with-osx use macOS (default port, Cocoa)], [wxUSE_OSX_COCOA="$withval" CACHE_OSX_COCOA=1 TOOLKIT_GIVEN=1]) WX_ARG_ONLY_WITH(cocoa, [ --with-cocoa same as --with-osx_cocoa], [wxUSE_OSX_COCOA="$withval" CACHE_OSX_COCOA=1 TOOLKIT_GIVEN=1]) WX_ARG_ONLY_WITH(iphone, [ --with-iphone same as --with-osx_iphone], [wxUSE_OSX_IPHONE="$withval" CACHE_OSX_IPHONE=1 TOOLKIT_GIVEN=1]) WX_ARG_ONLY_WITH(mac, [ --with-mac same as --with-osx], [wxUSE_OSX_COCOA="$withval" CACHE_OSX_COCOA=1 TOOLKIT_GIVEN=1]) @@ -577,12 +577,12 @@ WX_ARG_SYS_WITH(expat, [ --with-expat enable XML support using e if test "$USE_DARWIN" = 1; then -AC_ARG_WITH(macosx-sdk, [ --with-macosx-sdk=PATH use an OS X SDK at PATH], [ +AC_ARG_WITH(macosx-sdk, [ --with-macosx-sdk=PATH use macOS SDK at PATH], [ wxUSE_MACOSX_SDK=$withval wx_cv_use_macosx_sdk="wxUSE_MACOSX_SDK=$withval" ]) -AC_ARG_WITH(macosx-version-min, [ --with-macosx-version-min=VER build binaries which require at least this OS X version], [ +AC_ARG_WITH(macosx-version-min, [ --with-macosx-version-min=VER build binaries requiring at least this macOS version (default and lowest supported: 10.10)], [ wxUSE_MACOSX_VERSION_MIN=$withval wx_cv_use_macosx_version_min="wxUSE_MACOSX_VERSION_MIN=$withval" ]) @@ -1098,6 +1098,13 @@ if test "$CXX" = "g++" -a "$GXX" != "yes"; then AC_MSG_ERROR([C++ compiler is needed to build wxWidgets]) fi +dnl Always use C++11 under macOS, there are no supported compilers not +dnl supporting it there, but don't prevent a latest version of C++ from being +dnl used. +if test "$wxUSE_MAC" = 1 -a -z "$wxWITH_CXX"; then + wxWITH_CXX=11 +fi + if test -n "$wxWITH_CXX"; then dnl AX_CXX_COMPILE_STDCXX requires its VERSION argument to be specified at dnl autoconf, not run, time. @@ -1253,6 +1260,8 @@ if test "x$wxUSE_MACOSX_SDK" = "xno"; then elif test "x$wxUSE_MACOSX_SDK" = "xyes"; then dnl Try to use the default SDK. wxUSE_MACOSX_SDK="`xcode-select -p`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk" +elif test "x$wxUSE_MACOSX_SDK" != "x"; then + macosx_sdk_specified=yes fi @@ -1304,7 +1313,9 @@ dnl We need to quote the next line where we don't need macros and do need [] in wxUSE_MACOSX_VERSION_MIN= fi elif test "x$wxUSE_MACOSX_VERSION_MIN" = "x"; then - wxUSE_MACOSX_VERSION_MIN=10.9 + wxUSE_MACOSX_VERSION_MIN=10.10 +else + macosx_minver_specified=yes fi if test "x$MACOSX_SDK_OPTS" != "x"; then @@ -1328,27 +1339,48 @@ if test "x$wxUSE_MACOSX_VERSION_MIN" != "x"; then retest_macosx_linking=yes fi -if test "$HAVE_CXX11" = "1" ; then - dnl We also need to use libc++ standard library instead of libstdc++ for - dnl C++11 support, both when compiling (for both C++ and Objective-C++, so - dnl putting this in just CXXFLAGS wouldn't be enough) and when linking - dnl (both libraries and plugins, using bakefile shared-ld-sh script which - dnl doesn't handle this option, so putting it in LDFLAGS wouldn't work). - eval "CXX=\"$CXX -stdlib=libc++\"" -fi - dnl If either an SDK or a version option was added, make sure that we can dnl still compile and link both C and C++. If we didn't do this, then most dnl of the remaining tests would fail. if test "x$retest_macosx_linking" = "xyes"; then + if test "x$macosx_sdk_specified" = "xyes"; then + error_message="try using --with-macosx-sdk with a different SDK or \ +omitting it entirely to use the default one." + elif test "x$macosx_minver_specified" = "xyes"; then + error_message="try using --with-macosx-version-min with a different OS \ +version or omitting it entirely." + else + error_message="check that command line tools from Xcode 7.2.1 or later are installed." + fi + + error_message="building C++ programs doesn't work, $error_message" + AC_LANG_PUSH(C) AC_MSG_CHECKING([if C compiler ($CC) works with SDK/version options]) - AC_TRY_LINK([],[],[AC_MSG_RESULT([yes])],[AC_MSG_FAILURE([no. Try a different SDK]); exit 1]) + AC_TRY_LINK([],[],[AC_MSG_RESULT([yes])],[AC_MSG_FAILURE([$error_message])]) AC_LANG_POP() AC_LANG_PUSH(C++) AC_MSG_CHECKING([if C++ compiler ($CXX) works with SDK/version options]) - AC_TRY_LINK([],[],[AC_MSG_RESULT([yes])],[AC_MSG_FAILURE([no. Try a different SDK]); exit 1]) + AC_TRY_LINK( + [ + #include + ], + [ + #if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) + #if __MAC_OS_X_VERSION_MIN_REQUIRED < 101000 + #error macOS versions < 10.10 are not supported. + #endif + #if __MAC_OS_X_VERSION_MAX_ALLOWED < 101100 + #error macOS SDK version is too low, 10.11 or later is required. + #endif + #elif !defined(__IPHONE_OS_VERSION_MIN_REQUIRED) + #error unrecognized platform + #endif + ], + [AC_MSG_RESULT([yes])], + [AC_MSG_FAILURE([$error_message])] + ) AC_LANG_POP() fi diff --git a/docs/changes.txt b/docs/changes.txt index 6bdb254eb6..92a0efab73 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -152,9 +152,8 @@ Changes in behaviour which may result in build errors wxArrayString. Please update your code to use the appropriate setter Set[Char]{In,Ex}cludes(), instead of mutating the internal data directly. -- Under macOS, 10.9 SDK is used by default now. 10.7 SDK is still supported, - but must be explicitly selected (and libstdc++ must be installed in order - to use it). +- Under macOS, 10.11 SDK is the minimum SDK, building and deploying under 10.10.5 and + higher is supported, you must use at least Xcode 7.2.1. - wxPGProperty ctors are not longer public since this class is intended to be a base class and should not be instantiated directly. @@ -802,7 +801,7 @@ wxMSW: wxOSX/Cocoa: - Make wxiOS (iPhone) port build and minimally work again (Tobias Taschner). -- Use more efficient FSEvents (10.7+) in wxFileSystemWatcher (Roberto Perpuly). +- Use more efficient FSEvents in wxFileSystemWatcher (Roberto Perpuly). - Implement wxWindow::Disable() for non-native controls too (Steve Browne). - Implement wxTopLevelWindow::EnableCloseButton() (John Roberts). - Fix wxEVT_CHAR for non-BMP Unicode characters (ARATA Mizuki). diff --git a/docs/doxygen/mainpages/introduction.h b/docs/doxygen/mainpages/introduction.h index 6b692aa2b2..3c6f866937 100644 --- a/docs/doxygen/mainpages/introduction.h +++ b/docs/doxygen/mainpages/introduction.h @@ -91,10 +91,10 @@ NetBSD, Solaris, AIX, ...) and require GTK+ 2.6 or later or GTK+ 3.x. The primary supported compiler is GNU g++. @li wxOSX/Cocoa: This is the native port for Apple computers. wxOSX/Cocoa -supports 32 or 64 bit Intel Macs running macOS 10.7 or later. The port can be +supports 32 or 64 bit Intel Macs running macOS 10.10 or later. The port can be built either with g++ or clang. -Other platforms (e.g. iOS - with a minimum requirement of iOS 9), compilers (Borland C++ +Other platforms (e.g. iOS - with a minimum requirement of iOS 13), compilers (Borland C++ under Windows, Sun CC, HP-UX aCC, IBM xlC or SGI mipsPro under Unix) and ports ( wxQT, wxGTK1, wxX11, wxDFB...) are also supported but to a lesser extent. Please see the @subpage page_port "platform details page" for more information. diff --git a/docs/doxygen/mainpages/platdetails.h b/docs/doxygen/mainpages/platdetails.h index d2c530bdb5..122fc0a692 100644 --- a/docs/doxygen/mainpages/platdetails.h +++ b/docs/doxygen/mainpages/platdetails.h @@ -53,7 +53,7 @@ starting with 3.1.4. Use @c configure option @c \--with-gtk=2 to use GTK 2. @section page_port_wxosx wxOSX/Cocoa wxOSX/Cocoa is the port of wxWidgets for the macOS platform. It requires -macOS 10.7 or later and fully supports 64 bit builds. +macOS 10.10 or later, Xcode 7.2.1 or greater, and fully supports 64 bit builds. @subpage plat_osx_install "Build and Install Instructions" diff --git a/docs/readme.txt b/docs/readme.txt index 9d3ed484de..35eece3893 100644 --- a/docs/readme.txt +++ b/docs/readme.txt @@ -97,7 +97,7 @@ This version of wxWidgets supports the following primary platforms: * Windows XP, Vista, 7, 8 and 10 (32/64 bits). * Most Unix variants using the GTK+ toolkit (version 2.6 or newer) -* macOS (10.7 or newer) using Cocoa (32/64 bits) +* macOS (10.10 or newer) using Cocoa (32/64 bits) There is some support for the following platforms: diff --git a/interface/wx/app.h b/interface/wx/app.h index 41a9cea932..cae48e0c4c 100644 --- a/interface/wx/app.h +++ b/interface/wx/app.h @@ -755,8 +755,7 @@ public: std::locale::global(std::locale("")); @endcode but be warned that locale support in C++ standard library can be poor - or worse under some platforms, e.g. the above line results in an - immediate crash under macOS up to the version 10.8.2. + or worse under some platforms. @since 2.9.5 */ diff --git a/interface/wx/fswatcher.h b/interface/wx/fswatcher.h index b3d9bc8680..a5f8446e3a 100644 --- a/interface/wx/fswatcher.h +++ b/interface/wx/fswatcher.h @@ -85,7 +85,7 @@ public: Additionally a file mask can be specified to include only files matching that particular mask. - This method is implemented efficiently on MSW and macOS >= 10.7, but + This method is implemented efficiently on MSW and macOS, but should be used with care on other platforms for directories with lots of children (e.g. the root directory) as it calls Add() for each subdirectory, potentially creating a lot of watches and taking a long diff --git a/interface/wx/settings.h b/interface/wx/settings.h index 38784d15a1..1a692d274b 100644 --- a/interface/wx/settings.h +++ b/interface/wx/settings.h @@ -274,7 +274,7 @@ public: /** Return the name if available or empty string otherwise. - This is currently only implemented for macOS 10.9 or later and returns + This is currently only implemented for macOS and returns a not necessarily user-readable string such as "NSAppearanceNameAqua" there and an empty string under all the other platforms. */ diff --git a/interface/wx/toplevel.h b/interface/wx/toplevel.h index 13218c1e2e..18d3c6c374 100644 --- a/interface/wx/toplevel.h +++ b/interface/wx/toplevel.h @@ -646,9 +646,8 @@ public: under another OS. @note Having the button is also required to let ShowFullScreen() - make use of the full screen API available since macOS 10.7: a full - screen window gets its own space and entering and exiting the mode - is animated. + make use of the full screen API: a full screen window gets its own space + and entering and exiting the mode is animated. If the button is not present the old way of switching to full screen is used. diff --git a/src/html/htmlctrl/webkit/webkit.mm b/src/html/htmlctrl/webkit/webkit.mm index ef8f8a3797..1052900d6e 100644 --- a/src/html/htmlctrl/webkit/webkit.mm +++ b/src/html/htmlctrl/webkit/webkit.mm @@ -30,12 +30,6 @@ #define DEBUG_WEBKIT_SIZING 0 -#if defined(MAC_OS_X_VERSION_10_11) && (__MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_11) - #define wxWEBKIT_PROTOCOL_SINCE_10_11(proto) < proto > -#else - #define wxWEBKIT_PROTOCOL_SINCE_10_11(proto) -#endif - extern WXDLLEXPORT_DATA(const char) wxWebKitCtrlNameStr[] = "webkitctrl"; // ---------------------------------------------------------------------------- @@ -114,7 +108,7 @@ inline int wxNavTypeFromWebNavType(int type){ return wxWEBKIT_NAV_OTHER; } -@interface MyFrameLoadMonitor : NSObject wxWEBKIT_PROTOCOL_SINCE_10_11(WebFrameLoadDelegate) +@interface MyFrameLoadMonitor : NSObject { wxWebKitCtrl* webKitWindow; } @@ -123,7 +117,7 @@ inline int wxNavTypeFromWebNavType(int type){ @end -@interface MyPolicyDelegate : NSObject wxWEBKIT_PROTOCOL_SINCE_10_11(WebPolicyDelegate) +@interface MyPolicyDelegate : NSObject { wxWebKitCtrl* webKitWindow; } @@ -132,7 +126,7 @@ inline int wxNavTypeFromWebNavType(int type){ @end -@interface MyUIDelegate : NSObject wxWEBKIT_PROTOCOL_SINCE_10_11(WebUIDelegate) +@interface MyUIDelegate : NSObject { wxWebKitCtrl* webKitWindow; } diff --git a/src/osx/cocoa/dataview.mm b/src/osx/cocoa/dataview.mm index b093ca6a6d..257cafb949 100644 --- a/src/osx/cocoa/dataview.mm +++ b/src/osx/cocoa/dataview.mm @@ -3035,14 +3035,10 @@ bool wxDataViewTextRenderer::MacRender() [par setLineBreakMode:[cell lineBreakMode]]; // Tightening looks very ugly when combined with non-tightened rows, // so disabled it on OS X version where it's used: -#if __MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_11 if ( WX_IS_MACOS_AVAILABLE(10, 11) ) - { [par setAllowsDefaultTighteningForTruncation:NO]; - } else -#endif - [par setTighteningFactorForTruncation:0.0]; + [par setTighteningFactorForTruncation:0.0]; [str addAttribute:NSParagraphStyleAttributeName value:par diff --git a/src/osx/cocoa/window.mm b/src/osx/cocoa/window.mm index 739fead0b8..1ed6cf0ade 100644 --- a/src/osx/cocoa/window.mm +++ b/src/osx/cocoa/window.mm @@ -2828,15 +2828,7 @@ bool wxWidgetCocoaImpl::ShowWithEffect(bool show, return ShowViewOrWindowWithEffect(m_wxPeer, show, effect, timeout); } -// To avoid warnings about incompatible pointer types with OS X 10.11 SDK (and -// maybe even earlier? This has changed at some time between 10.9 and 10.11), -// we need to constrain the comparison function arguments instead of just using -// "id". -#if __MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_11 && __has_feature(objc_kindof) typedef __kindof NSView* KindOfView; -#else -typedef id KindOfView; -#endif class CocoaWindowCompareContext { diff --git a/src/osx/core/colour.cpp b/src/osx/core/colour.cpp index 9430d914d3..17d80c629f 100644 --- a/src/osx/core/colour.cpp +++ b/src/osx/core/colour.cpp @@ -118,7 +118,6 @@ wxCGColorRefData::wxCGColorRefData(CGColorRef col) } else if (model != kCGColorSpaceModelRGB) { -#if __MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_11 if ( WX_IS_MACOS_AVAILABLE(10, 11) ) { rgbacol = CGColorCreateCopyByMatchingToColorSpace(wxMacGetGenericRGBColorSpace(), kCGRenderingIntentDefault, col, NULL); @@ -126,7 +125,6 @@ wxCGColorRefData::wxCGColorRefData(CGColorRef col) components = CGColorGetComponents(rgbacol); } else -#endif { isRGB = false; } diff --git a/src/osx/webview_webkit.mm b/src/osx/webview_webkit.mm index c5bf2bcc16..77bfc3dc9e 100644 --- a/src/osx/webview_webkit.mm +++ b/src/osx/webview_webkit.mm @@ -44,12 +44,6 @@ #define DEBUG_WEBKIT_SIZING 0 -#if defined(MAC_OS_X_VERSION_10_11) && (__MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_11) - #define wxWEBKIT_PROTOCOL_SINCE_10_11(proto) < proto > -#else - #define wxWEBKIT_PROTOCOL_SINCE_10_11(proto) -#endif - // ---------------------------------------------------------------------------- // macros // ---------------------------------------------------------------------------- @@ -59,7 +53,7 @@ wxIMPLEMENT_DYNAMIC_CLASS(wxWebViewWebKit, wxWebView); wxBEGIN_EVENT_TABLE(wxWebViewWebKit, wxControl) wxEND_EVENT_TABLE() -@interface WebViewLoadDelegate : NSObject wxWEBKIT_PROTOCOL_SINCE_10_11(WebFrameLoadDelegate) +@interface WebViewLoadDelegate : NSObject { wxWebViewWebKit* webKitWindow; } @@ -68,7 +62,7 @@ wxEND_EVENT_TABLE() @end -@interface WebViewPolicyDelegate : NSObject wxWEBKIT_PROTOCOL_SINCE_10_11(WebPolicyDelegate) +@interface WebViewPolicyDelegate : NSObject { wxWebViewWebKit* webKitWindow; } @@ -77,7 +71,7 @@ wxEND_EVENT_TABLE() @end -@interface WebViewUIDelegate : NSObject wxWEBKIT_PROTOCOL_SINCE_10_11(WebUIDelegate) +@interface WebViewUIDelegate : NSObject { wxWebViewWebKit* webKitWindow; } diff --git a/src/ribbon/art_aui.cpp b/src/ribbon/art_aui.cpp index 97d3750ec1..d2eca5a256 100644 --- a/src/ribbon/art_aui.cpp +++ b/src/ribbon/art_aui.cpp @@ -244,11 +244,10 @@ void wxRibbonAUIArtProvider::SetColourScheme( m_tab_ctrl_background_colour = LikePrimary(0.9); #ifdef __WXMAC__ - if ( wxPlatformInfo::Get().CheckOSVersion(10, 10 ) ) - m_tab_ctrl_background_gradient_colour = m_tab_ctrl_background_colour; - else -#endif + m_tab_ctrl_background_gradient_colour = m_tab_ctrl_background_colour; +#else m_tab_ctrl_background_gradient_colour = LikePrimary(1.7); +#endif m_tab_border_pen = LikePrimary(0.75); #ifdef __WXMAC__ m_tab_label_colour = wxSystemSettings::GetColour(wxSYS_COLOUR_CAPTIONTEXT); @@ -259,19 +258,17 @@ void wxRibbonAUIArtProvider::SetColourScheme( m_tab_hover_label_colour = m_tab_label_colour; m_tab_hover_background_top_colour = primary_hsl.ToRGB(); #ifdef __WXMAC__ - if ( wxPlatformInfo::Get().CheckOSVersion(10, 10 ) ) - m_tab_hover_background_top_gradient_colour = m_tab_hover_background_top_colour; - else -#endif + m_tab_hover_background_top_gradient_colour = m_tab_hover_background_top_colour; +#else m_tab_hover_background_top_gradient_colour = LikePrimary(1.6); +#endif m_tab_hover_background_brush = m_tab_hover_background_top_colour; m_tab_active_background_colour = m_tab_ctrl_background_gradient_colour; #ifdef __WXMAC__ - if ( wxPlatformInfo::Get().CheckOSVersion(10, 10 ) ) - m_tab_active_background_gradient_colour = m_tab_active_background_colour; - else -#endif + m_tab_active_background_gradient_colour = m_tab_active_background_colour; +#else m_tab_active_background_gradient_colour = primary_hsl.ToRGB(); +#endif m_tab_active_top_background_brush = m_tab_active_background_colour; m_panel_label_colour = m_tab_label_colour; m_panel_minimised_label_colour = m_panel_label_colour;