VirtualBox

Changeset 85163 in vbox


Ignore:
Timestamp:
Jul 10, 2020 9:53:41 AM (4 years ago)
Author:
vboxsync
Message:

IPRT/RTPathUserDocuments-darwin.cpp: Addressed API deprecation. bugref:9790

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/darwin/RTPathUserDocuments-darwin.cpp

    r82968 r85163  
    3636#include <iprt/err.h>
    3737
    38 #include <NSSystemDirectories.h>
     38#if MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
     39# include <sysdir.h>
     40#else
     41# include <NSSystemDirectories.h>
     42#endif
    3943#include <sys/syslimits.h>
    4044#ifdef IPRT_USE_CORE_SERVICE_FOR_USER_DOCUMENTS
     
    5357    /*
    5458     * Try NSSystemDirectories first since that works for directories that doesn't exist.
     59     * The NSSystemDirectories API was renamed in 10.12 to sysdir.
    5560     */
    5661    int rc = VERR_PATH_NOT_FOUND;
     62#if MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
     63    sysdir_search_path_enumeration_state EnmState = sysdir_start_search_path_enumeration(SYSDIR_DIRECTORY_DOCUMENT,
     64                                                                                         SYSDIR_DOMAIN_MASK_USER);
     65#else
    5766    NSSearchPathEnumerationState EnmState = NSStartSearchPathEnumeration(NSDocumentDirectory, NSUserDomainMask);
     67#endif
    5868    if (EnmState != 0)
    5969    {
    6070        char szTmp[PATH_MAX];
    6171        szTmp[0] = szTmp[PATH_MAX - 1] = '\0';
     72#if MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
     73        EnmState = sysdir_get_next_search_path_enumeration(EnmState, szTmp);
     74#else
    6275        EnmState = NSGetNextSearchPathEnumeration(EnmState, szTmp);
     76#endif
    6377        if (EnmState != 0)
    6478        {
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette