VirtualBox

Changeset 12379 in vbox for trunk/src/libs/xpcom18a4/python


Ignore:
Timestamp:
Sep 10, 2008 9:53:10 PM (16 years ago)
Author:
vboxsync
Message:

xpcom/VBoxPython2_5: seems the initializer function needs to be init+module name.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/python/src/module/_xpcom.cpp

    r11904 r12379  
    7272
    7373#ifdef VBOX_PYXPCOM
    74 #define MODULE_NAME "VBoxPython"
     74# ifdef VBOX_PYXPCOM_VERSIONED
     75#  if PY_VERSION_HEX >= 0x02080000
     76#   define MODULE_NAME "VBoxPython2_8"
     77#  elif PY_VERSION_HEX >= 0x02070000
     78#   define MODULE_NAME "VBoxPython2_7"
     79#  elif PY_VERSION_HEX >= 0x02060000
     80#   define MODULE_NAME "VBoxPython2_6"
     81#  elif PY_VERSION_HEX >= 0x02050000
     82#   define MODULE_NAME "VBoxPython2_5"
     83#  elif PY_VERSION_HEX >= 0x02040000
     84#   define MODULE_NAME "VBoxPython2_4"
     85#  elif PY_VERSION_HEX >= 0x02030000
     86#   define MODULE_NAME "VBoxPython2_3"
     87#  else
     88#   error "Fix module versioning.
     89#  endif
     90# else
     91#  define MODULE_NAME "VBoxPython"
     92# endif
    7593#else
    7694#define MODULE_NAME "_xpcom"
     
    163181        return PyXPCOMMethod_GetComponentManager(self, args);
    164182}
    165                
     183
    166184static PyObject *
    167185PyXPCOMMethod_XPTI_GetInterfaceInfoManager(PyObject *self, PyObject *args)
     
    208226        // will return the "original" gateway when QI'd for nsISupports)
    209227        if (!Py_nsISupports::InterfaceFromPyObject(
    210                         obIS, 
    211                         Py_nsIID_NULL, 
    212                         getter_AddRefs(pis), 
     228                        obIS,
     229                        Py_nsIID_NULL,
     230                        getter_AddRefs(pis),
    213231                        PR_FALSE))
    214232                return NULL;
     
    266284        nsIInternalPython *iob = NULL;
    267285        PyObject *ret = NULL;
    268         if (!Py_nsISupports::InterfaceFromPyObject(ob, 
    269                                 NS_GET_IID(nsISupports), 
    270                                 &uob, 
     286        if (!Py_nsISupports::InterfaceFromPyObject(ob,
     287                                NS_GET_IID(nsISupports),
     288                                &uob,
    271289                                PR_FALSE))
    272290                goto done;
     
    356374        nsCOMPtr<nsISupports> presult;
    357375        Py_BEGIN_ALLOW_THREADS;
    358         nsCOMPtr<nsIProxyObjectManager> proxyMgr = 
     376        nsCOMPtr<nsIProxyObjectManager> proxyMgr =
    359377                 do_GetService(kProxyObjectManagerCID, &rv_proxy);
    360378
     
    404422
    405423        nsCOMPtr<nsIVariant> var;
    406         if (!Py_nsISupports::InterfaceFromPyObject(ob, 
    407                                 NS_GET_IID(nsISupports), 
    408                                 getter_AddRefs(var), 
     424        if (!Py_nsISupports::InterfaceFromPyObject(ob,
     425                                NS_GET_IID(nsISupports),
     426                                getter_AddRefs(var),
    409427                                PR_FALSE))
    410428                return PyErr_Format(PyExc_ValueError,
     
    482500        {"GetServiceManager", PyXPCOMMethod_GetServiceManager, 1},
    483501        {"GetGlobalServiceManager", PyXPCOMMethod_GetGlobalServiceManager, 1}, // deprecated
    484         {"IID", PyXPCOMMethod_IID, 1}, // IID is wrong - deprecated - not just IID, but CID, etc. 
     502        {"IID", PyXPCOMMethod_IID, 1}, // IID is wrong - deprecated - not just IID, but CID, etc.
    485503        {"ID", PyXPCOMMethod_IID, 1}, // This is the official name.
    486504        {"NS_ShutdownXPCOM", PyXPCOMMethod_NS_ShutdownXPCOM, 1},
     
    517535//
    518536extern "C" NS_EXPORT
    519 void 
     537void
    520538init_xpcom() {
    521539        PyObject *oModule;
     
    591609
    592610extern "C" NS_EXPORT
    593 void
     611void
     612# ifdef VBOX_PYXPCOM_VERSIONED
     613#  if PY_VERSION_HEX >= 0x02080000
     614initVBoxPython2_8() {
     615#  elif PY_VERSION_HEX >= 0x02070000
     616initVBoxPython2_7() {
     617#  elif PY_VERSION_HEX >= 0x02060000
     618initVBoxPython2_6() {
     619#  elif PY_VERSION_HEX >= 0x02050000
     620initVBoxPython2_5() {
     621#  elif PY_VERSION_HEX >= 0x02040000
     622#   error "you must test VBOX_PYXPCOM_VERSIONED on 2.4"
    594623initVBoxPython() {
     624#  elif PY_VERSION_HEX >= 0x02030000
     625#   error "you must test VBOX_PYXPCOM_VERSIONED on 2.3"
     626initVBoxPython() {
     627#  else
     628#   error "Fix module versioning.
     629#  endif
     630# else
     631initVBoxPython() {
     632# endif
    595633  static bool s_vboxInited = false;
    596634  if (!s_vboxInited) {
     
    610648      rc = RTR3Init();
    611649    }
    612 #endif 
     650#endif
    613651
    614652    rc = com::Initialize();
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