VirtualBox

Ignore:
Timestamp:
Jul 8, 2018 1:23:58 PM (6 years ago)
Author:
vboxsync
Message:

Main: Some early sketches on how to get proper C++ enums with xpidl.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/HostNetworkInterfaceImpl.cpp

    r69500 r72973  
    175175        m.realIPV6PrefixLength = m.IPV6NetworkMaskPrefixLength = iPrefixIPv6;
    176176        m.hardwareAddress = Bstr(Utf8StrFmt("%RTmac", &info.MACAddress));
    177 #ifdef RT_OS_WINDOWS
    178         m.mediumType = (HostNetworkInterfaceMediumType)info.enmMediumType;
    179         m.status = (HostNetworkInterfaceStatus)info.enmStatus;
    180 #else /* !RT_OS_WINDOWS */
    181         m.mediumType = info.enmMediumType;
    182         m.status = info.enmStatus;
    183 #endif /* !RT_OS_WINDOWS */
     177        AssertCompile((unsigned)NETIF_T_UNKNOWN == (unsigned)HostNetworkInterfaceMediumType_Unknown);
     178        m.mediumType = (HostNetworkInterfaceMediumType_T)info.enmMediumType;
     179        AssertCompile((unsigned)NETIF_S_UNKNOWN == (unsigned)HostNetworkInterfaceStatus_Unknown);
     180        m.status = (HostNetworkInterfaceStatus_T)info.enmStatus;
    184181        m.speedMbits = info.uSpeedMbits;
    185182        m.wireless = info.fWireless;
     
    239236    m.dhcpEnabled = pIf->fDhcpEnabled;
    240237    m.hardwareAddress = Bstr(Utf8StrFmt("%RTmac", &pIf->MACAddress));
    241 #ifdef RT_OS_WINDOWS
    242     m.mediumType = (HostNetworkInterfaceMediumType)pIf->enmMediumType;
    243     m.status = (HostNetworkInterfaceStatus)pIf->enmStatus;
    244 #else /* !RT_OS_WINDOWS */
    245     m.mediumType = pIf->enmMediumType;
    246     m.status = pIf->enmStatus;
    247 #endif /* !RT_OS_WINDOWS */
     238    AssertCompile((unsigned)NETIF_T_UNKNOWN == (unsigned)HostNetworkInterfaceMediumType_Unknown);
     239    m.mediumType = (HostNetworkInterfaceMediumType_T)pIf->enmMediumType;
     240    AssertCompile((unsigned)NETIF_S_UNKNOWN == (unsigned)HostNetworkInterfaceStatus_Unknown);
     241    m.status = (HostNetworkInterfaceStatus_T)pIf->enmStatus;
    248242    m.speedMbits = pIf->uSpeedMbits;
    249243    m.wireless = pIf->fWireless;
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