VirtualBox

Changeset 102315 in vbox


Ignore:
Timestamp:
Nov 27, 2023 1:24:58 PM (16 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
160449
Message:

libs/xpcom: Remove VBOX_MACOSX_FOLLOWS_UNIX_IO which is the default for a long time now and get rid of the OSX specific code which is not used, bugref:10545

Location:
trunk/src/libs/xpcom18a4
Files:
3 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/Config.kmk

    r102307 r102315  
    109109 TEMPLATE_XPComDll_DEFS.darwin        = XP_UNIX=1 XP_MACOSX=1 TARGET_CARBON=1 HAVE_VISIBILITY_ATTRIBUTE=1 $(TEMPLATE_VBoxR3DllNonPedantic_DEFS.darwin)
    110110endif
    111 TEMPLATE_XPComDll_DEFS.darwin.amd64   = VBOX_MACOSX_FOLLOWS_UNIX_IO
    112 TEMPLATE_XPComDll_DEFS.darwin.arm64   = VBOX_MACOSX_FOLLOWS_UNIX_IO
    113111ifdef VBOX_WITH_AUTOMATIC_DEFS_QUOTING
    114112 TEMPLATE_XPComDll_DEFS.freebsd       = XP_UNIX=1 HAVE_VISIBILITY_ATTRIBUTE=1
  • trunk/src/libs/xpcom18a4/Makefile.kmk

    r102314 r102315  
    243243        xpcom/io/nsLocalFile.h \
    244244        xpcom/io/nsLocalFileUnix.h \
    245         xpcom/io/nsLocalFileOSX.h \
    246245        xpcom/components/nsModule.h \
    247246        xpcom/io/nsNativeCharsetUtils.h \
     
    463462        xpcom/ds/nsArray.cpp \
    464463        xpcom/ds/nsArrayEnumerator.cpp
    465 #   xpcom/ds/nsHashPropertyBag.cpp
    466464$(evalcall VBOX_XPCOM_X86,VBox-xpcom-ds)
    467465
  • trunk/src/libs/xpcom18a4/xpcom/io/nsAppFileLocationProvider.cpp

    r101962 r102315  
    4848#include "nsCRT.h"
    4949
    50 #if (defined(XP_MAC) || defined(XP_MACOSX)) && !defined(VBOX_MACOSX_FOLLOWS_UNIX_IO)
    51 #include <Folders.h>
    52 #include <Script.h>
    53 #include <Processes.h>
    54 #include <Gestalt.h>
    55 #include "nsILocalFileMac.h"
    56 #elif defined(XP_OS2)
    57 #define INCL_DOSPROCESS
    58 #define INCL_DOSMODULEMGR
    59 #include <os2.h>
    60 #elif defined(XP_WIN)
    61 #include <windows.h>
    62 #include <shlobj.h>
    63 #elif defined(XP_UNIX)
     50#if defined(XP_UNIX)
    6451#include <unistd.h>
    6552#include <stdlib.h>
    6653#include <sys/param.h>
    67 #elif defined(XP_BEOS)
    68 #include <sys/param.h>
    69 #include <kernel/image.h>
    70 #include <storage/FindDirectory.h>
     54#else
     55# error "Not implemented"
    7156#endif
    7257
     
    148133    *persistant = PR_TRUE;
    149134
    150 #if (defined (XP_MAC) || defined(XP_MACOSX)) && !defined(VBOX_MACOSX_FOLLOWS_UNIX_IO)
    151     short foundVRefNum;
    152     SInt32 foundDirID;
    153     FSSpec fileSpec;
    154     nsCOMPtr<nsILocalFileMac> macFile;
    155 #endif
    156 
    157135    if (nsCRT::strcmp(prop, NS_APP_APPLICATION_REGISTRY_DIR) == 0)
    158136    {
     
    212190            rv = localFile->AppendRelativeNativePath(PLUGINS_DIR_NAME);
    213191    }
    214 #if (defined(XP_MAC) || defined(XP_MACOSX)) && !defined(VBOX_MACOSX_FOLLOWS_UNIX_IO)
    215     else if (nsCRT::strcmp(prop, NS_MACOSX_USER_PLUGIN_DIR) == 0)
    216     {
    217         if (!(::FindFolder(kUserDomain,
    218                            kInternetPlugInFolderType,
    219                            kDontCreateFolder, &foundVRefNum, &foundDirID)) &&
    220             !(::FSMakeFSSpec(foundVRefNum, foundDirID, "\p", &fileSpec))) {
    221             rv = NS_NewLocalFileWithFSSpec(&fileSpec, PR_TRUE, getter_AddRefs(macFile));
    222             if (NS_SUCCEEDED(rv))
    223                 localFile = macFile;
    224         }
    225     }
    226     else if (nsCRT::strcmp(prop, NS_MACOSX_LOCAL_PLUGIN_DIR) == 0)
    227     {
    228         if (!(::FindFolder(kLocalDomain,
    229                            kInternetPlugInFolderType,
    230                            kDontCreateFolder, &foundVRefNum, &foundDirID)) &&
    231             !(::FSMakeFSSpec(foundVRefNum, foundDirID, "\p", &fileSpec))) {
    232             rv = NS_NewLocalFileWithFSSpec(&fileSpec, PR_TRUE, getter_AddRefs(macFile));
    233             if (NS_SUCCEEDED(rv))
    234                 localFile = macFile;
    235         }
    236     }
    237     else if (nsCRT::strcmp(prop, NS_MAC_CLASSIC_PLUGIN_DIR) == 0)
    238     {
    239         if (!(::FindFolder(kOnAppropriateDisk,
    240                            kInternetPlugInFolderType,
    241                            kDontCreateFolder, &foundVRefNum, &foundDirID)) &&
    242             !(::FSMakeFSSpec(foundVRefNum, foundDirID, "\p", &fileSpec))) {
    243             rv = NS_NewLocalFileWithFSSpec(&fileSpec, PR_TRUE, getter_AddRefs(macFile));
    244             if (NS_SUCCEEDED(rv))
    245                 localFile = macFile;
    246         }
    247     }
    248 #else
    249192    else if (nsCRT::strcmp(prop, NS_ENV_PLUGINS_DIR) == 0)
    250193    {
     
    261204            rv = localFile->AppendRelativeNativePath(PLUGINS_DIR_NAME);
    262205    }
    263 #endif
    264206    else if (nsCRT::strcmp(prop, NS_APP_SEARCH_DIR) == 0)
    265207    {
     
    273215        // with their own cleanup dir.  See bugzilla bug #105087
    274216        rv = CloneMozBinDirectory(getter_AddRefs(localFile));
    275 #ifdef XP_MAC
    276         if (NS_SUCCEEDED(rv))
    277             rv = localFile->AppendNative(ESSENTIAL_FILES);
    278 #endif
    279 
    280217    }
    281218
     
    340277    nsCOMPtr<nsILocalFile> localDir;
    341278
    342 #if defined(XP_MAC)
    343     nsCOMPtr<nsIProperties> directoryService =
    344              do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv);
    345     if (NS_FAILED(rv)) return rv;
    346     OSErr   err;
    347     long    response;
    348     err = ::Gestalt(gestaltSystemVersion, &response);
    349     const char *prop = (!err && response >= 0x00001000) ? NS_MAC_USER_LIB_DIR : NS_MAC_DOCUMENTS_DIR;
    350     rv = directoryService->Get(prop, NS_GET_IID(nsILocalFile), getter_AddRefs(localDir));
    351     if (NS_FAILED(rv)) return rv;
    352 #elif defined(XP_MACOSX) && !defined(VBOX_MACOSX_FOLLOWS_UNIX_IO)
    353     FSRef fsRef;
    354     OSErr err = ::FSFindFolder(kUserDomain, kDomainLibraryFolderType, kCreateFolder, &fsRef);
    355     if (err) return NS_ERROR_FAILURE;
    356     NS_NewLocalFile(EmptyString(), PR_TRUE, getter_AddRefs(localDir));
    357     if (!localDir) return NS_ERROR_FAILURE;
    358     nsCOMPtr<nsILocalFileMac> localDirMac(do_QueryInterface(localDir));
    359     rv = localDirMac->InitWithFSRef(&fsRef);
    360     if (NS_FAILED(rv)) return rv;
    361 #elif defined(XP_OS2)
    362     nsCOMPtr<nsIProperties> directoryService =
    363              do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv);
    364     if (NS_FAILED(rv)) return rv;
    365     rv = directoryService->Get(NS_OS2_HOME_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(localDir));
    366     if (NS_FAILED(rv)) return rv;
    367 #elif defined(XP_WIN)
    368     nsCOMPtr<nsIProperties> directoryService =
    369              do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv);
    370     if (NS_FAILED(rv)) return rv;
    371     rv = directoryService->Get(NS_WIN_APPDATA_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(localDir));
    372     if (NS_SUCCEEDED(rv))
    373         rv = localDir->Exists(&exists);
    374     if (NS_FAILED(rv) || !exists)
    375     {
    376         // On some Win95 machines, NS_WIN_APPDATA_DIR does not exist - revert to NS_WIN_WINDOWS_DIR
    377         localDir = nsnull;
    378         rv = directoryService->Get(NS_WIN_WINDOWS_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(localDir));
    379     }
    380     if (NS_FAILED(rv)) return rv;
    381 #elif defined(XP_UNIX)
     279#if defined(XP_UNIX)
    382280    rv = NS_NewNativeLocalFile(nsDependentCString(RTEnvGet("HOME")), PR_TRUE, getter_AddRefs(localDir));
    383     if (NS_FAILED(rv)) return rv;
    384 #elif defined(XP_BEOS)
    385     char path[MAXPATHLEN];
    386     find_directory(B_USER_SETTINGS_DIRECTORY, 0, 0, path, MAXPATHLEN);
    387     // Need enough space to add the trailing backslash
    388     int len = strlen(path);
    389     if (len > MAXPATHLEN-2)
    390         return NS_ERROR_FAILURE;
    391     path[len]   = '/';
    392     path[len+1] = '\0';
    393     rv = NS_NewNativeLocalFile(nsDependentCString(path), PR_TRUE, getter_AddRefs(localDir));
    394281    if (NS_FAILED(rv)) return rv;
    395282#else
     
    581468    if (!nsCRT::strcmp(prop, NS_APP_PLUGINS_DIR_LIST))
    582469    {
    583 #if (defined(XP_MAC) || defined(XP_MACOSX)) && !defined(VBOX_MACOSX_FOLLOWS_UNIX_IO)
    584         static const char* osXKeys[] = { NS_APP_PLUGINS_DIR, NS_MACOSX_USER_PLUGIN_DIR, NS_MACOSX_LOCAL_PLUGIN_DIR, nsnull };
    585         static const char* os9Keys[] = { NS_APP_PLUGINS_DIR, NS_MAC_CLASSIC_PLUGIN_DIR, nsnull };
    586         static const char** keys;
    587 
    588         if (!keys) {
    589             OSErr err;
    590             SInt32 response;
    591             err = ::Gestalt(gestaltSystemVersion, &response);
    592             keys = (!err && response >= 0x00001000) ? osXKeys : os9Keys;
    593         }
    594 
    595         *_retval = new nsAppDirectoryEnumerator(this, keys);
    596 #else
    597470        static const char* keys[] = { nsnull, NS_APP_PLUGINS_DIR, nsnull };
    598471        if (!keys[0] && !(keys[0] = RTEnvGet("VBOX_XPCOM_PLUGIN_PATH"))) {
     
    601474        }
    602475        *_retval = new nsPathsDirectoryEnumerator(this, keys);
    603 #endif
     476
    604477        NS_IF_ADDREF(*_retval);
    605478        rv = *_retval ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
  • trunk/src/libs/xpcom18a4/xpcom/io/nsLocalFile.h

    r102195 r102315  
    7272#include "nsILocalFile.h"
    7373
    74 #if defined(XP_MACOSX) && !defined(VBOX_MACOSX_FOLLOWS_UNIX_IO)
    75 #include "nsLocalFileOSX.h"
    76 #elif defined(XP_UNIX) || defined(XP_BEOS)
     74#if defined(XP_UNIX) || defined(XP_BEOS)
    7775#include "nsLocalFileUnix.h"
    7876#else
  • trunk/src/libs/xpcom18a4/xpcom/io/nsLocalFileCommon.cpp

    r16402 r102315  
    6262}
    6363
    64 #if (!defined(XP_MAC) && !defined(XP_MACOSX)) || defined(VBOX_MACOSX_FOLLOWS_UNIX_IO)
    6564NS_IMETHODIMP
    6665nsLocalFile::InitWithFile(nsILocalFile *aFile)
     
    7473    return InitWithNativePath(path);
    7574}
    76 #endif
    77 
    78 #if defined(XP_MAC)
    79 #define kMaxFilenameLength 31
    80 #else
     75
    8176#define kMaxFilenameLength 255
    82 #endif
    8377
    8478NS_IMETHODIMP
     
    128122}
    129123
    130 #if defined(XP_MAC)
    131 static const PRUnichar kPathSeparatorChar       = ':';
    132 #elif defined(XP_WIN) || defined(XP_OS2)
    133 static const PRUnichar kPathSeparatorChar       = '\\';
    134 #elif defined(XP_UNIX) || defined(XP_BEOS)
     124#if defined(XP_UNIX)
    135125static const PRUnichar kPathSeparatorChar       = '/';
    136126#else
    137127#error Need to define file path separator for your platform
    138 #endif
    139 
    140 #if defined(XP_MAC)
    141 static const char kSlashStr[] = "/";
    142 static const char kESCSlashStr[] = "%2F";
    143128#endif
    144129
     
    201186
    202187    for (nodeIndex = 0; nodeIndex < thisNodeCnt && nodeIndex < fromNodeCnt; ++nodeIndex) {
    203 #ifdef XP_WIN
    204       if (_wcsicmp(thisNodes[nodeIndex], fromNodes[nodeIndex]))
    205         break;
    206 #else
    207188      if (nsCRT::strcmp(thisNodes[nodeIndex], fromNodes[nodeIndex]))
    208189        break;
    209 #endif
    210190    }
    211191
     
    215195    for (nodeIndex = branchIndex; nodeIndex < thisNodeCnt; nodeIndex++) {
    216196      NS_ConvertUCS2toUTF8 nodeStr(thisNodes[nodeIndex]);
    217 #ifdef XP_MAC
    218       nodeStr.ReplaceSubstring(kSlashStr, kESCSlashStr);
    219 #endif
    220197      _retval.Append(nodeStr);
    221198      if (nodeIndex + 1 < thisNodeCnt)
     
    262239    while (nodeEnd != strEnd) {
    263240      FindCharInReadable('/', nodeEnd, strEnd);
    264 #ifdef XP_MAC
    265       nsCAutoString nodeString(Substring(nodeBegin, nodeEnd));
    266       nodeString.ReplaceSubstring(kESCSlashStr, kSlashStr);
    267       targetFile->Append(NS_ConvertUTF8toUCS2(nodeString));
    268 #else
    269241      targetFile->Append(NS_ConvertUTF8toUCS2(Substring(nodeBegin, nodeEnd)));
    270 #endif
    271242      if (nodeEnd != strEnd) // If there's more left in the string, inc over the '/' nodeEnd is on.
    272243        ++nodeEnd;
Note: See TracChangeset for help on using the changeset viewer.

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