VirtualBox

Changeset 3191 in vbox for trunk


Ignore:
Timestamp:
Jun 20, 2007 10:26:49 PM (18 years ago)
Author:
vboxsync
Message:

Main: Made it build on OS/2.

Location:
trunk
Files:
1 added
13 edited

Legend:

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

    r2981 r3191  
    3131#include <iprt/types.h>
    3232
     33#if !defined (VBOX_WITH_XPCOM)
     34
    3335#if defined (__WIN__)
    3436
     
    4446#define NS_IMPL_ISUPPORTS1_CI(a, b)
    4547
    46 // these are XPCOM only, one for every interface implemented
     48/* these are XPCOM only, one for every interface implemented */
    4749#define NS_DECL_ISUPPORTS
    4850#define NS_DECL_IVIRTUALBOX
     
    5052#define NS_DECL_IMACHINE
    5153
    52 // input pointer argument to method
     54/* input pointer argument to method */
    5355#define INPTR
    5456
    55 // makes the name of the getter interface function (n must be capitalized)
     57/* makes the name of the getter interface function (n must be capitalized) */
    5658#define COMGETTER(n)    get_##n
    57 // makes the name of the setter interface function (n must be capitalized)
     59/* makes the name of the setter interface function (n must be capitalized) */
    5860#define COMSETTER(n)    put_##n
    5961
    60 // a type for an input GUID parameter in the interface method declaration
     62/* a type for an input GUID parameter in the interface method declaration */
    6163#define GUIDPARAM           GUID
    62 // a type for an output GUID parameter in the interface method declaration
     64/* a type for an output GUID parameter in the interface method declaration */
    6365#define GUIDPARAMOUT        GUID*
    6466
     
    7173#define COM_IIDOF(I) _ATL_IIDOF (I)
    7274
    73 #else // !defined (__WIN__)
     75#else // defined (__WIN__)
     76
     77#error "VBOX_WITH_XPCOM is not defined!"
     78
     79#endif // defined (__WIN__)
     80
     81#else // !defined (VBOX_WITH_XPCOM)
    7482
    7583// XPCOM
    7684/////////////////////////////////////////////////////////////////////////////
     85
     86#if defined (__OS2__)
     87
     88/* Make sure OS/2 Toolkit headers are pulled in to have
     89 * BOOL/ULONG/etc. typedefs already defined in order to be able to redefine
     90 * them using #define. */
     91#include <os2.h>
     92
     93/* OS/2 Toolkit defines TRUE and FALSE */
     94#undef FALSE
     95#undef TRUE
     96
     97#endif // defined (__OS2__)
    7798
    7899#include <nsID.h>
     
    112133#define TRUE PR_TRUE
    113134
    114 // makes the name of the getter interface function (n must be capitalized)
     135/* makes the name of the getter interface function (n must be capitalized) */
    115136#define COMGETTER(n)    Get##n
    116 // makes the name of the setter interface function (n must be capitalized)
     137/* makes the name of the setter interface function (n must be capitalized) */
    117138#define COMSETTER(n)    Set##n
    118139
    119 // a type to define a raw GUID variable (better to use the Guid class)
     140/* a type to define a raw GUID variable (better to use the Guid class) */
    120141#define GUID                nsID
    121 // a type for an input GUID parameter in the interface method declaration
     142/* a type for an input GUID parameter in the interface method declaration */
    122143#define GUIDPARAM           nsID &
    123 // a type for an output GUID parameter in the interface method declaration
     144/* a type for an output GUID parameter in the interface method declaration */
    124145#define GUIDPARAMOUT        nsID **
    125146
    126 // CLSID and IID for compatibility with Win32
     147/* CLSID and IID for compatibility with Win32 */
    127148typedef nsCID   CLSID;
    128149typedef nsIID   IID;
    129150
    130 // OLE error codes
     151/* OLE error codes */
    131152#define S_OK                NS_OK
    132153#define E_UNEXPECTED        NS_ERROR_UNEXPECTED
     
    147168#define COM_IIDOF(I) NS_GET_IID (I)
    148169
    149 // two very simple ATL emulator classes to provide
    150 // FinalConstruct()/FinalRelease() functionality on Linux
     170/* two very simple ATL emulator classes to provide
     171 * FinalConstruct()/FinalRelease() functionality on Linux */
    151172
    152173class CComObjectRootEx
     
    163184};
    164185
    165 // input pointer argument to method
     186/* input pointer argument to method */
    166187#define INPTR const
    167188
    168 // helper functions
     189/* helper functions */
    169190extern "C"
    170191{
  • trunk/src/VBox/Main/AudioAdapterImpl.cpp

    r2981 r3191  
    233233            case AudioDriverType_CoreAudioDriver:
    234234#endif
     235#ifdef __OS2__
     236            case AudioDriverType_MMPMAudioDriver:
     237#endif
    235238            {
    236239                mData.backup();
  • trunk/src/VBox/Main/ConsoleImpl.cpp

    r3155 r3191  
    60076007        /** @todo Implement tap networking for Darwin. */
    60086008        int rcVBox = VERR_NOT_IMPLEMENTED;
     6009#elif defined(__OS2__)
     6010        /** @todo Implement tap networking for OS/2. */
     6011        int rcVBox = VERR_NOT_IMPLEMENTED;
    60096012#elif defined(VBOX_WITH_UNIXY_TAP_NETWORKING)
    60106013# error "PORTME: Implement OS specific TAP interface open/creation."
     
    65736576        static const char * const s_apszGroups[] = VBOX_LOGGROUP_NAMES;
    65746577        RTUINT fFlags = RTLOGFLAGS_PREFIX_TIME_PROG;
    6575 #ifdef __WIN__
     6578#if defined (__WIN__) || defined (__OS2__)
    65766579        fFlags |= RTLOGFLAGS_USECRLF;
    6577 #endif /* __WIN__ */
     6580#endif
    65786581        char szError[RTPATH_MAX + 128] = "";
    65796582        vrc = RTLogCreateEx(&loggerRelease, fFlags, "all",
  • trunk/src/VBox/Main/MachineImpl.cpp

    r3072 r3191  
    42374237            audioDriver = AudioDriverType_CoreAudioDriver;
    42384238#endif
     4239#ifdef __OS2__
     4240        else if (driver == L"mmpm")
     4241            audioDriver = AudioDriverType_MMPMAudioDriver;
     4242#endif
    42394243        else
    42404244            AssertMsgFailed (("Invalid driver: %ls\n", driver.raw()));
     
    60416045            }
    60426046#endif
     6047#ifdef __OS2__
     6048            case AudioDriverType_MMPMAudioDriver:
     6049            {
     6050                CFGLDRSetString (adapterNode, "driver", "mmpm");
     6051                break;
     6052            }
     6053#endif
    60436054            default:
    60446055                ComAssertMsgFailedBreak (("Wrong audio driver type! driver = %d\n",
  • trunk/src/VBox/Main/Makefile.kmk

    r3188 r3191  
    446446VBOX_XML_SCHEMA.linux  = xml/VirtualBox-settings-linux.xsd
    447447VBOX_XML_SCHEMA.win    = xml/VirtualBox-settings-windows.xsd
     448VBOX_XML_SCHEMA.os2    = xml/VirtualBox-settings-os2.xsd
    448449
    449450VirtualBoxXMLUtil.cpp_DEPS = $(VBOX_XML_ENTITIES) $(VBOX_XML_ENTITIES_COMMON)
  • trunk/src/VBox/Main/ProgressImpl.cpp

    r2981 r3191  
    2020 */
    2121
    22 #if !defined (__WIN__)
     22#if defined (VBOX_WITH_XPCOM)
    2323#include <nsIServiceManager.h>
    2424#include <nsIExceptionService.h>
    2525#include <nsCOMPtr.h>
    26 #endif // !defined (__WIN__)
     26#endif // defined (VBOX_WITH_XPCOM)
    2727
    2828#include "ProgressImpl.h"
     
    768768        /* try to import error info from the current thread */
    769769
     770#if !defined (VBOX_WITH_XPCOM)
    770771#if defined (__WIN__)
    771772
     
    779780        }
    780781
    781 #else // !defined (__WIN__)
     782#endif // !defined (__WIN__)
     783#else // !defined (VBOX_WITH_XPCOM)
    782784
    783785        nsCOMPtr <nsIExceptionService> es;
     
    799801            }
    800802        }
    801 #endif // !defined (__WIN__)
     803#endif // !defined (VBOX_WITH_XPCOM)
    802804
    803805        AssertMsg (rc == S_OK, ("Couldn't get error info (rc=%08X) while trying "
  • trunk/src/VBox/Main/VirtualBoxBase.cpp

    r2981 r3191  
    2020 */
    2121
     22#if !defined (VBOX_WITH_XPCOM)
    2223#if defined (__WIN__)
    2324#include <windows.h>
    2425#include <dbghelp.h>
    25 #else // !defined (__WIN__)
     26#endif
     27#else // !defined (VBOX_WITH_XPCOM)
    2628#include <nsIServiceManager.h>
    2729#include <nsIExceptionService.h>
    28 #endif
     30#endif // !defined (VBOX_WITH_XPCOM)
    2931
    3032#include "VirtualBoxBase.h"
     
    507509    AssertReturn (aLock, (void) 0);
    508510
    509 #if defined(__LINUX__) && defined(__GNUC__)
     511#if (defined(__LINUX__) || defined(__OS2__)) && defined(__GNUC__)
    510512
    511513    RTCritSectEnterDebug (aLock,
     
    570572    RTCritSectEnter (aLock);
    571573
    572 #endif // defined(__LINUX__)
     574#endif // defined(__LINUX__)...
    573575}
    574576
     
    671673        CheckComRCBreakRC (rc);
    672674
     675#if !defined (VBOX_WITH_XPCOM)
    673676#if defined (__WIN__)
    674677
     
    707710            rc = ::SetErrorInfo (0, err);
    708711
    709 #else // !defined (__WIN__)
     712#endif
     713#else // !defined (VBOX_WITH_XPCOM)
    710714
    711715        nsCOMPtr <nsIExceptionService> es;
     
    769773        }
    770774
    771 #endif // !defined (__WIN__)
     775#endif // !defined (VBOX_WITH_XPCOM)
    772776    }
    773777    while (0);
  • trunk/src/VBox/Main/VirtualBoxErrorInfoImpl.cpp

    r2981 r3191  
    8787}
    8888
     89#if !defined (VBOX_WITH_XPCOM)
    8990#if defined (__WIN__)
    9091
     
    142143}
    143144
    144 #else // !defined (__WIN__)
     145#endif // defined (__WIN__)
     146#else // !defined (VBOX_WITH_XPCOM)
    145147
    146148/**
     
    241243                               nsIException, IVirtualBoxErrorInfo)
    242244
    243 #endif
    244 
     245#endif // !defined (VBOX_WITH_XPCOM)
     246
  • trunk/src/VBox/Main/VirtualBoxImpl.cpp

    r3116 r3191  
    33283328        aId = &aHardDisk->id();
    33293329        if (aHardDisk->storageType() == HardDiskStorageType_VirtualDiskImage)
     3330#if !defined (VBOX_WITH_XPCOM)
    33303331#if defined(__WIN__)
    33313332            /// @todo (dmik) stupid BSTR declaration lacks the BCSTR counterpart
    33323333            const_cast <BSTR> (aFilePathFull) = aHardDisk->asVDI()->filePathFull();
     3334#endif
    33333335#else
    33343336            aFilePathFull = aHardDisk->asVDI()->filePathFull();
  • trunk/src/VBox/Main/glue/com.cpp

    r2981 r3191  
    160160        /* compose the config directory (full path) */
    161161        vrc = RTPathUserHome (path, sizeof (path));
    162         aDir = Utf8StrFmt ("%s%c%s", path, RTPATH_DELIMITER,
    163                            VBOX_USER_HOME_SUFFIX);
     162        if (RT_SUCCESS (vrc))
     163            aDir = Utf8StrFmt ("%s%c%s", path, RTPATH_DELIMITER,
     164                               VBOX_USER_HOME_SUFFIX);
    164165    }
    165166
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r3153 r3191  
    73007300    <enum
    73017301        name="AudioDriverType"
    7302         uuid="0194b900-7233-42d3-b7a1-097bbf53febd"
     7302        uuid="4bcc3d73-c2fe-40db-b72f-0c2ca9d68496"
    73037303    >
    73047304        <const name="NullAudioDriver"   value="0"/>
     
    73087308        <const name="DSOUNDAudioDriver" value="4"/>
    73097309        <const name="CoreAudioDriver"   value="5"/>
     7310        <const name="MMPMAudioDriver"   value="5"/>
    73107311    </enum>
    73117312
  • trunk/src/VBox/Main/include/VirtualBoxXMLUtil.h

    r2981 r3191  
    4242#elif defined (__DARWIN__)
    4343#   define VBOX_XML_PLATFORM     "macosx"
     44#elif defined (__OS2__)
     45#   define VBOX_XML_PLATFORM     "os2"
    4446#else
    4547#   error Unsupported platform!
  • trunk/src/VBox/Main/linux/server.cpp

    r3117 r3191  
    815815 *  nsMyModuleComponentInfo::mFactoryConstructor.
    816816 */
    817 NS_COM nsresult
     817nsresult
    818818NS_NewMyFactory(nsIGenericFactory* *result,
    819819                const nsMyModuleComponentInfo *info)
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