VirtualBox

Changeset 960 in vbox for trunk/src/libs/xpcom18a4/xpcom


Ignore:
Timestamp:
Feb 17, 2007 9:12:10 AM (18 years ago)
Author:
vboxsync
Message:

Darwin hacking.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/xpcom/glue/standalone/nsXPCOMGlue.cpp

    r1 r960  
    111111
    112112        xpcomLib = PR_LoadLibraryWithFlags(libSpec, PR_LD_LAZY|PR_LD_GLOBAL);
     113#ifdef __DARWIN__
     114        /* works around bundle problem. */
     115        if (!xpcomLib) {
     116            const char *home = PR_GetEnv("VBOX_XPCOM_HOME");
     117            if (home) {
     118                char path[PATH_MAX];
     119                snprintf(path, sizeof(path), "%s/%s", home, libSpec.value.pathname);
     120                libSpec.value.pathname = path;
     121                xpcomLib = PR_LoadLibraryWithFlags(libSpec, PR_LD_LAZY|PR_LD_GLOBAL);
     122            }
     123        }
     124#endif
    113125        if (!xpcomLib)
    114126            return NS_ERROR_FAILURE;
     
    162174        xpcomLib = nsnull;
    163175    }
    164    
     176
    165177    memset(&xpcomFunctions, 0, sizeof(xpcomFunctions));
    166178    return NS_OK;
     
    170182#ifndef XPCOM_GLUE_NO_DYNAMIC_LOADING
    171183extern "C" NS_COM nsresult
    172 NS_InitXPCOM2(nsIServiceManager* *result, 
     184NS_InitXPCOM2(nsIServiceManager* *result,
    173185              nsIFile* binDirectory,
    174186              nsIDirectoryServiceProvider* appFileLocationProvider)
     
    442454      }
    443455  }
    444                  
     456
    445457#if XP_WIN32
    446   // On windows, the current directory is searched before the 
    447   // PATH environment variable.  This is a very bad thing 
     458  // On windows, the current directory is searched before the
     459  // PATH environment variable.  This is a very bad thing
    448460  // since libraries in the cwd will be picked up before
    449461  // any that are in either the application or GRE directory.
     
    465477    // Startup the XPCOM Glue that links us up with XPCOM.
    466478    nsresult rv = XPCOMGlueStartup(xpcomLocation);
    467    
     479
    468480    if (NS_FAILED(rv)) {
    469481        NS_WARNING("gre: XPCOMGlueStartup failed");
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