VirtualBox

Changeset 60766 in vbox for trunk/include/VBox/com


Ignore:
Timestamp:
Apr 29, 2016 2:56:19 PM (9 years ago)
Author:
vboxsync
Message:

Main: XPCOM build fix for previous big change

Location:
trunk/include/VBox/com
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/com/defs.h

    r60765 r60766  
    279279
    280280#include <nsID.h>
    281 
    282 #ifndef VBOX_COM_NO_ATL
    283 
    284 namespace ATL
    285 {
    286 
    287 #define ATL_NO_VTABLE
    288 #define DECLARE_CLASSFACTORY(a)
    289 #define DECLARE_CLASSFACTORY_SINGLETON(a)
    290 #define DECLARE_REGISTRY_RESOURCEID(a)
    291 #define DECLARE_NOT_AGGREGATABLE(a)
    292 #define DECLARE_PROTECT_FINAL_CONSTRUCT()
    293 #define BEGIN_COM_MAP(a)
    294 #define COM_INTERFACE_ENTRY(a)
    295 #define COM_INTERFACE_ENTRY2(a,b)
    296 #define END_COM_MAP() NS_DECL_ISUPPORTS
    297 #define COM_INTERFACE_ENTRY_AGGREGATE(a,b)
    298 
    299 /* A few very simple ATL emulator classes to provide
    300  * FinalConstruct()/FinalRelease() functionality with XPCOM. */
    301 
    302 class CComMultiThreadModel
    303 {
    304 };
    305 
    306 template <class DummyThreadModel> class CComObjectRootEx
    307 {
    308 public:
    309     HRESULT FinalConstruct()
    310     {
    311         return S_OK;
    312     }
    313     void FinalRelease()
    314     {
    315     }
    316 };
    317 
    318 template <class DummyThreadModel> class CComObject
    319 {
    320 public:
    321     virtual ~CComObject() { this->FinalRelease(); }
    322 };
    323 
    324 } /* namespace ATL */
    325 
    326 #endif /* !VBOX_COM_NO_ATL */
    327281
    328282#define HRESULT     nsresult
     
    442396#ifndef VBOX_COM_NO_ATL
    443397
     398namespace ATL
     399{
     400
     401#define ATL_NO_VTABLE
     402#define DECLARE_CLASSFACTORY(a)
     403#define DECLARE_CLASSFACTORY_SINGLETON(a)
     404#define DECLARE_REGISTRY_RESOURCEID(a)
     405#define DECLARE_NOT_AGGREGATABLE(a)
     406#define DECLARE_PROTECT_FINAL_CONSTRUCT()
     407#define BEGIN_COM_MAP(a)
     408#define COM_INTERFACE_ENTRY(a)
     409#define COM_INTERFACE_ENTRY2(a,b)
     410#define END_COM_MAP() NS_DECL_ISUPPORTS
     411#define COM_INTERFACE_ENTRY_AGGREGATE(a,b)
     412
     413/* A few very simple ATL emulator classes to provide
     414 * FinalConstruct()/FinalRelease() functionality with XPCOM. */
     415
     416class CComMultiThreadModel
     417{
     418};
     419
     420template <class DummyThreadModel> class CComObjectRootEx
     421{
     422public:
     423    HRESULT FinalConstruct()
     424    {
     425        return S_OK;
     426    }
     427    void FinalRelease()
     428    {
     429    }
     430};
     431
     432template <class Base> class CComObject : public Base
     433{
     434public:
     435    virtual ~CComObject() { this->FinalRelease(); }
     436};
     437
     438} /* namespace ATL */
     439
     440
    444441/**
    445442 *  'Constructor' for the component class.
     
    463460    }                                                                         \
    464461                                                                              \
    465     CComObject<_InstanceClass> *inst = new CComObject<_InstanceClass>();      \
     462    ATL::CComObject<_InstanceClass> *inst = new ATL::CComObject<_InstanceClass>(); \
    466463    if (NULL == inst) {                                                       \
    467464        rv = NS_ERROR_OUT_OF_MEMORY;                                          \
  • trunk/include/VBox/com/ptr.h

    r60504 r60766  
    490490# endif
    491491#else /* VBOX_WITH_XPCOM */
    492         CComObject<T> *obj = new CComObject<T>();
     492        ATL::CComObject<T> *obj = new ATL::CComObject<T>();
    493493        if (obj)
    494494            rc = obj->FinalConstruct();
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