VirtualBox

Changeset 85121 in vbox for trunk/src/VBox/Main/include


Ignore:
Timestamp:
Jul 8, 2020 7:33:26 PM (4 years ago)
Author:
vboxsync
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/Main/include
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/DisplayImpl.h

    r84740 r85121  
    410410public:
    411411
    412     static int i_displayTakeScreenshotEMT(Display *pDisplay, ULONG aScreenId, uint8_t **ppbData, size_t *pcbData,
    413                                           uint32_t *pcx, uint32_t *pcy, bool *pfMemFree);
     412    static DECLCALLBACK(int) i_displayTakeScreenshotEMT(Display *pDisplay, ULONG aScreenId, uint8_t **ppbData, size_t *pcbData,
     413                                                        uint32_t *pcx, uint32_t *pcy, bool *pfMemFree);
    414414
    415415private:
    416     static int i_InvalidateAndUpdateEMT(Display *pDisplay, unsigned uId, bool fUpdateAll);
    417     static int i_drawToScreenEMT(Display *pDisplay, ULONG aScreenId, BYTE *address, ULONG x, ULONG y, ULONG width, ULONG height);
     416    static DECLCALLBACK(int) i_InvalidateAndUpdateEMT(Display *pDisplay, unsigned uId, bool fUpdateAll);
     417    static DECLCALLBACK(int) i_drawToScreenEMT(Display *pDisplay, ULONG aScreenId, BYTE *address, ULONG x, ULONG y,
     418                                               ULONG width, ULONG height);
    418419
    419420    void i_updateGuestGraphicsFacility(void);
  • trunk/src/VBox/Main/include/GuestDnDPrivate.h

    r85018 r85121  
    953953
    954954/** Guest DnD callback function definition. */
    955 typedef DECLCALLBACKPTR(int, PFNGUESTDNDCALLBACK) (uint32_t uMsg, void *pvParms, size_t cbParms, void *pvUser);
     955typedef DECLCALLBACKPTR(int, PFNGUESTDNDCALLBACK,(uint32_t uMsg, void *pvParms, size_t cbParms, void *pvUser));
    956956
    957957/**
  • trunk/src/VBox/Main/include/HGCMThread.h

    r82968 r85121  
    5555 *         (shouldn't happen).
    5656 */
    57 typedef DECLCALLBACK(int) HGCMMSGCALLBACK(int32_t result, HGCMMsgCore *pMsgCore);
     57typedef DECLCALLBACKTYPE(int, FNHGCMMSGCALLBACK,(int32_t result, HGCMMsgCore *pMsgCore));
    5858/** Pointer to a message completeion callback function. */
    59 typedef HGCMMSGCALLBACK *PHGCMMSGCALLBACK;
     59typedef FNHGCMMSGCALLBACK *PFNHGCMMSGCALLBACK;
    6060
    6161
     
    7676
    7777        /** Callback function pointer. */
    78         PHGCMMSGCALLBACK m_pfnCallback;
     78        PFNHGCMMSGCALLBACK m_pfnCallback;
    7979
    8080        /** Next element in a message queue. */
     
    115115 *  @param pvUser        User specified thread parameter.
    116116 */
    117 typedef DECLCALLBACK(void) FNHGCMTHREAD(HGCMThread *pThread, void *pvUser);
     117typedef DECLCALLBACKTYPE(void, FNHGCMTHREAD,(HGCMThread *pThread, void *pvUser));
    118118typedef FNHGCMTHREAD *PFNHGCMTHREAD;
    119119
     
    179179 * @thread any
    180180 */
    181 int hgcmMsgPost(HGCMMsgCore *pMsg, PHGCMMSGCALLBACK pfnCallback);
     181int hgcmMsgPost(HGCMMsgCore *pMsg, PFNHGCMMSGCALLBACK pfnCallback);
    182182
    183183/** Send a message to HGCM worker thread.
  • trunk/src/VBox/Main/include/MachineDebuggerImpl.h

    r82968 r85121  
    141141
    142142    /** RTLogGetFlags, RTLogGetGroupSettings and RTLogGetDestinations function. */
    143     typedef DECLCALLBACK(int) FNLOGGETSTR(PRTLOGGER, char *, size_t);
     143    typedef DECLCALLBACKTYPE(int, FNLOGGETSTR,(PRTLOGGER, char *, size_t));
    144144    /** Function pointer.  */
    145145    typedef FNLOGGETSTR *PFNLOGGETSTR;
  • trunk/src/VBox/Main/include/VirtualBoxImpl.h

    r83169 r85121  
    146146
    147147#ifdef RT_OS_WINDOWS
    148     typedef DECLCALLBACKPTR(HRESULT, SVCHelperClientFunc)
    149         (SVCHlpClient *aClient, Progress *aProgress, void *aUser, int *aVrc);
     148    typedef DECLCALLBACKPTR(HRESULT, SVCHelperClientFunc,(SVCHlpClient *aClient, Progress *aProgress, void *aUser, int *aVrc));
    150149    HRESULT i_startSVCHelperClient(bool aPrivileged,
    151150                                   SVCHelperClientFunc aFunc,
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