VirtualBox

Changeset 85121 in vbox for trunk/src/VBox/NetworkServices


Ignore:
Timestamp:
Jul 8, 2020 7:33:26 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
139061
Message:

iprt/cdefs.h: Refactored the typedef use of DECLCALLBACK as well as DECLCALLBACKMEMBER to wrap the whole expression, similar to the DECLR?CALLBACKMEMBER macros. This allows adding a throw() at the end when compiling with the VC++ compiler to indicate that the callbacks won't throw anything, so we can stop supressing the C5039 warning about passing functions that can potential throw C++ exceptions to extern C code that can't necessarily cope with such (unwind,++). Introduced a few _EX variations that allows specifying different/no calling convention too, as that's handy when dynamically resolving host APIs. Fixed numerous places missing DECLCALLBACK and such. Left two angry @todos regarding use of CreateThread. bugref:9794

Location:
trunk/src/VBox/NetworkServices
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/NetworkServices/Dhcpd/VBoxNetDhcpd.cpp

    r83779 r85121  
    157157    void lwipInit();
    158158
    159     static err_t netifInitCB(netif *pNetif);
     159    static err_t netifInitCB(netif *pNetif) RT_NOTHROW_PROTO;
    160160    err_t netifInit(netif *pNetif);
    161161
    162     static err_t netifLinkOutputCB(netif *pNetif, pbuf *pPBuf);
     162    static err_t netifLinkOutputCB(netif *pNetif, pbuf *pPBuf) RT_NOTHROW_PROTO;
    163163    err_t netifLinkOutput(pbuf *pPBuf);
    164164
    165165    static void dhcp4RecvCB(void *arg, struct udp_pcb *pcb, struct pbuf *p,
    166                             ip_addr_t *addr, u16_t port);
     166                            ip_addr_t *addr, u16_t port) RT_NOTHROW_PROTO;
    167167    void dhcp4Recv(struct udp_pcb *pcb, struct pbuf *p, ip_addr_t *addr, u16_t port);
    168168};
     
    584584
    585585
    586 /* static */ err_t VBoxNetDhcpd::netifInitCB(netif *pNetif)
     586/* static */ err_t VBoxNetDhcpd::netifInitCB(netif *pNetif) RT_NOTHROW_DEF
    587587{
    588588    AssertPtrReturn(pNetif, ERR_ARG);
     
    593593
    594594
    595 /* static */ err_t VBoxNetDhcpd::netifLinkOutputCB(netif *pNetif, pbuf *pPBuf)
     595/* static */ err_t VBoxNetDhcpd::netifLinkOutputCB(netif *pNetif, pbuf *pPBuf) RT_NOTHROW_DEF
    596596{
    597597    AssertPtrReturn(pNetif, ERR_ARG);
     
    607607/* static */ void VBoxNetDhcpd::dhcp4RecvCB(void *arg, struct udp_pcb *pcb,
    608608                                            struct pbuf *p,
    609                                             ip_addr_t *addr, u16_t port)
     609                                            ip_addr_t *addr, u16_t port) RT_NOTHROW_DEF
    610610{
    611611    AssertPtrReturnVoid(arg);
  • trunk/src/VBox/NetworkServices/NAT/VBoxNetLwipNAT.cpp

    r83806 r85121  
    183183    static DECLCALLBACK(void) onLwipTcpIpInit(void *arg);
    184184    static DECLCALLBACK(void) onLwipTcpIpFini(void *arg);
    185     static err_t netifInit(netif *pNetif);
    186     static err_t netifLinkoutput(netif *pNetif, pbuf *pBuf);
     185    static err_t netifInit(netif *pNetif) RT_NOTHROW_PROTO;
     186    static err_t netifLinkoutput(netif *pNetif, pbuf *pBuf) RT_NOTHROW_PROTO;
    187187    /* static int intNetThreadRecv(RTTHREAD, void *); - unused */
    188188
     
    529529 * Callback for netif_add() to initialize the interface.
    530530 */
    531 /*static*/ err_t VBoxNetLwipNAT::netifInit(netif *pNetif)
     531/*static*/ err_t VBoxNetLwipNAT::netifInit(netif *pNetif) RT_NOTHROW_DEF
    532532{
    533533    err_t rcLwip = ERR_OK;
     
    591591
    592592
    593 /*static*/ err_t VBoxNetLwipNAT::netifLinkoutput(netif *pNetif, pbuf *pPBuf)
     593/*static*/ err_t VBoxNetLwipNAT::netifLinkoutput(netif *pNetif, pbuf *pPBuf) RT_NOTHROW_DEF
    594594{
    595595    AssertPtrReturn(pNetif, ERR_ARG);
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