VirtualBox

Changeset 16394 in vbox for trunk


Ignore:
Timestamp:
Jan 29, 2009 11:07:40 PM (16 years ago)
Author:
vboxsync
Message:

XPCOM-darwin/amd64: Take the UNIX path in nsAppFileLocationProvider.cpp.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/xpcom/io/nsAppFileLocationProvider.cpp

    r1 r16394  
    4949#include "nsCRT.h"
    5050
    51 #if defined(XP_MAC) || defined(XP_MACOSX)
     51#if (defined(XP_MAC) || defined(XP_MACOSX)) && (!defined(VBOX) || !defined(RT_ARCH_AMD64))
    5252#include <Folders.h>
    5353#include <Script.h>
     
    148148    *persistant = PR_TRUE;
    149149
    150 #if defined (XP_MAC) || defined(XP_MACOSX)
     150#if (defined (XP_MAC) || defined(XP_MACOSX)) && (!defined(VBOX) || !defined(RT_ARCH_AMD64))
    151151    short foundVRefNum;
    152152    long foundDirID;
     
    154154    nsCOMPtr<nsILocalFileMac> macFile;
    155155#endif
    156    
     156
    157157    if (nsCRT::strcmp(prop, NS_APP_APPLICATION_REGISTRY_DIR) == 0)
    158158    {
     
    212212            rv = localFile->AppendRelativeNativePath(PLUGINS_DIR_NAME);
    213213    }
    214 #if defined(XP_MAC) || defined(XP_MACOSX)
     214#if (defined(XP_MAC) || defined(XP_MACOSX)) && (!defined(VBOX) || !defined(RT_ARCH_AMD64))
    215215    else if (nsCRT::strcmp(prop, NS_MACOSX_USER_PLUGIN_DIR) == 0)
    216216    {
     
    269269    }
    270270    else if (nsCRT::strcmp(prop, NS_APP_INSTALL_CLEANUP_DIR) == 0)
    271     {   
     271    {
    272272        // This is cloned so that embeddors will have a hook to override
    273         // with their own cleanup dir.  See bugzilla bug #105087 
     273        // with their own cleanup dir.  See bugzilla bug #105087
    274274        rv = CloneMozBinDirectory(getter_AddRefs(localFile));
    275275#ifdef XP_MAC
     
    278278#endif
    279279
    280     } 
     280    }
    281281
    282282    if (localFile && NS_SUCCEEDED(rv))
    283283        return localFile->QueryInterface(NS_GET_IID(nsIFile), (void**)_retval);
    284        
     284
    285285    return rv;
    286286}
     
    341341
    342342#if defined(XP_MAC)
    343     nsCOMPtr<nsIProperties> directoryService = 
     343    nsCOMPtr<nsIProperties> directoryService =
    344344             do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv);
    345345    if (NS_FAILED(rv)) return rv;
     
    350350    rv = directoryService->Get(prop, NS_GET_IID(nsILocalFile), getter_AddRefs(localDir));
    351351    if (NS_FAILED(rv)) return rv;
    352 #elif defined(XP_MACOSX)
     352#elif defined(XP_MACOSX) && (!defined(VBOX) || !defined(RT_ARCH_AMD64))
    353353    FSRef fsRef;
    354354    OSErr err = ::FSFindFolder(kUserDomain, kDomainLibraryFolderType, kCreateFolder, &fsRef);
     
    360360    if (NS_FAILED(rv)) return rv;
    361361#elif defined(XP_OS2)
    362     nsCOMPtr<nsIProperties> directoryService = 
     362    nsCOMPtr<nsIProperties> directoryService =
    363363             do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv);
    364364    if (NS_FAILED(rv)) return rv;
     
    366366    if (NS_FAILED(rv)) return rv;
    367367#elif defined(XP_WIN)
    368     nsCOMPtr<nsIProperties> directoryService = 
     368    nsCOMPtr<nsIProperties> directoryService =
    369369             do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv);
    370370    if (NS_FAILED(rv)) return rv;
     
    470470    }
    471471
    472     NS_IMETHOD HasMoreElements(PRBool *result) 
     472    NS_IMETHOD HasMoreElements(PRBool *result)
    473473    {
    474474        while (!mNext && *mCurrentKey)
     
    486486    }
    487487
    488     NS_IMETHOD GetNext(nsISupports **result) 
     488    NS_IMETHOD GetNext(nsISupports **result)
    489489    {
    490490        NS_ENSURE_ARG_POINTER(result);
     
    495495        if (!hasMore)
    496496            return NS_ERROR_FAILURE;
    497            
     497
    498498        *result = mNext;
    499499        NS_IF_ADDREF(*result);
    500500        mNext = nsnull;
    501        
     501
    502502        return *result ? NS_OK : NS_ERROR_FAILURE;
    503503    }
     
    543543    }
    544544
    545     NS_IMETHOD HasMoreElements(PRBool *result) 
     545    NS_IMETHOD HasMoreElements(PRBool *result)
    546546    {
    547547        if (mEndPath)
     
    582582    *_retval = nsnull;
    583583    nsresult rv = NS_ERROR_FAILURE;
    584    
     584
    585585    if (!nsCRT::strcmp(prop, NS_APP_PLUGINS_DIR_LIST))
    586586    {
    587 #if defined(XP_MAC) || defined(XP_MACOSX)
     587#if (defined(XP_MAC) || defined(XP_MACOSX)) && (!defined(VBOX) || !defined(RT_ARCH_AMD64))
    588588        static const char* osXKeys[] = { NS_APP_PLUGINS_DIR, NS_MACOSX_USER_PLUGIN_DIR, NS_MACOSX_LOCAL_PLUGIN_DIR, nsnull };
    589589        static const char* os9Keys[] = { NS_APP_PLUGINS_DIR, NS_MAC_CLASSIC_PLUGIN_DIR, nsnull };
    590590        static const char** keys;
    591        
     591
    592592        if (!keys) {
    593593            OSErr err;
    594594            long response;
    595             err = ::Gestalt(gestaltSystemVersion, &response); 
     595            err = ::Gestalt(gestaltSystemVersion, &response);
    596596            keys = (!err && response >= 0x00001000) ? osXKeys : os9Keys;
    597597        }
     
    607607#endif
    608608        NS_IF_ADDREF(*_retval);
    609         rv = *_retval ? NS_OK : NS_ERROR_OUT_OF_MEMORY;       
     609        rv = *_retval ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
    610610    }
    611611    return rv;
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