VirtualBox

Ignore:
Timestamp:
Jul 8, 2020 7:33:26 PM (5 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/ValidationKit/utils
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/utils/cpu/cidet-app.cpp

    r82968 r85121  
    186186
    187187#ifdef RT_OS_WINDOWS
    188 static int CidetAppXcptFilter(EXCEPTION_POINTERS *pXcptPtrs)
     188static int CidetAppXcptFilter(EXCEPTION_POINTERS *pXcptPtrs) RT_NOTHROW_DEF
    189189{
    190190    /*
     
    382382 * @param   pXcptPtrs   The exception record.
    383383 */
    384 static LONG CALLBACK CidetAppVectoredXcptHandler(EXCEPTION_POINTERS *pXcptPtrs)
     384static LONG CALLBACK CidetAppVectoredXcptHandler(EXCEPTION_POINTERS *pXcptPtrs) RT_NOTHROW_DEF
    385385{
    386386    RTStrmPrintf(g_pStdErr, "CidetAppVectoredXcptHandler!\n");
     
    398398 * @param   pXcptPtrs   The exception record.
    399399 */
    400 static LONG CALLBACK CidetAppUnhandledXcptFilter(EXCEPTION_POINTERS *pXcptPtrs)
     400static LONG CALLBACK CidetAppUnhandledXcptFilter(EXCEPTION_POINTERS *pXcptPtrs) RT_NOTHROW_DEF
    401401{
    402402    RTStrmPrintf(g_pStdErr, "CidetAppUnhandledXcptFilter!\n");
  • trunk/src/VBox/ValidationKit/utils/cpu/cidet.h

    r82968 r85121  
    121121 *                          cause exceptions/faults.
    122122 */
    123 typedef DECLCALLBACK(int) FNCIDETSETUPINOUT(struct CIDETCORE *pThis, bool fInvalid);
     123typedef DECLCALLBACKTYPE(int, FNCIDETSETUPINOUT,(struct CIDETCORE *pThis, bool fInvalid));
    124124/** Pointer to a FNCIDETSETUPINOUT function. */
    125125typedef FNCIDETSETUPINOUT *PFNCIDETSETUPINOUT;
     
    807807     * @param   pBuf            Pointer to the buffer structure.
    808808     */
    809     DECLCALLBACKMEMBER(bool, pfnReInitDataBuf)(struct CIDETCORE *pThis, PCIDETBUF pBuf);
     809    DECLCALLBACKMEMBER(bool, pfnReInitDataBuf,(struct CIDETCORE *pThis, PCIDETBUF pBuf));
    810810
    811811    /**
     
    818818     *                          given in pfnReinitBuf call).
    819819     */
    820     DECLCALLBACKMEMBER(bool, pfnSetupDataBuf)(struct CIDETCORE *pThis, PCIDETBUF pBuf, void const *pvSrc);
     820    DECLCALLBACKMEMBER(bool, pfnSetupDataBuf,(struct CIDETCORE *pThis, PCIDETBUF pBuf, void const *pvSrc));
    821821
    822822    /**
     
    834834     *                          buffer offset given in pfnReinitBuf call).
    835835     */
    836     DECLCALLBACKMEMBER(bool, pfnIsBufEqual)(struct CIDETCORE *pThis, struct CIDETBUF *pBuf, void const *pvExpected);
     836    DECLCALLBACKMEMBER(bool, pfnIsBufEqual,(struct CIDETCORE *pThis, struct CIDETBUF *pBuf, void const *pvExpected));
    837837
    838838    /**
     
    845845     *                          execute.
    846846     */
    847     DECLCALLBACKMEMBER(bool, pfnReInitCodeBuf)(struct CIDETCORE *pThis, PCIDETBUF pBuf);
     847    DECLCALLBACKMEMBER(bool, pfnReInitCodeBuf,(struct CIDETCORE *pThis, PCIDETBUF pBuf));
    848848
    849849    /**
     
    855855     * @param   pvInstr         Pointer to the encoded instruction bytes.
    856856     */
    857     DECLCALLBACKMEMBER(bool, pfnSetupCodeBuf)(struct CIDETCORE *pThis, PCIDETBUF pBuf, void const *pvInstr);
     857    DECLCALLBACKMEMBER(bool, pfnSetupCodeBuf,(struct CIDETCORE *pThis, PCIDETBUF pBuf, void const *pvInstr));
    858858
    859859    /**
     
    863863     * @param   pThis           Pointer to the core structure.
    864864     */
    865     DECLCALLBACKMEMBER(bool, pfnExecute)(struct CIDETCORE *pThis);
     865    DECLCALLBACKMEMBER(bool, pfnExecute,(struct CIDETCORE *pThis));
    866866
    867867    /**
     
    872872     * @param   va              Arguments referenced in @a pszFormat.
    873873     */
    874     DECLCALLBACKMEMBER(void, pfnFailure)(struct CIDETCORE *pThis, const char *pszFormat, va_list va);
     874    DECLCALLBACKMEMBER(void, pfnFailure,(struct CIDETCORE *pThis, const char *pszFormat, va_list va));
    875875
    876876    /** Array of indexes for use by FNCIDETSETUPINOUT.
  • trunk/src/VBox/ValidationKit/utils/serial/SerialTest.cpp

    r82968 r85121  
    8383 * @param   pSerialTest         The serial test instance data.
    8484 */
    85 typedef DECLCALLBACK(int) FNSERIALTESTRUN(PSERIALTEST pSerialTest);
     85typedef DECLCALLBACKTYPE(int, FNSERIALTESTRUN,(PSERIALTEST pSerialTest));
    8686/** Pointer to the serial test callback. */
    8787typedef FNSERIALTESTRUN *PFNSERIALTESTRUN;
  • trunk/src/VBox/ValidationKit/utils/usb/UsbTest.cpp

    r82968 r85121  
    122122 * @param   pParams         The USB test parameters to set up.
    123123 */
    124 typedef DECLCALLBACK(int) FNUSBTESTPARAMSSETUP(unsigned idxTest, const char *pszTest, PUSBTESTPARAMS pParams);
     124typedef DECLCALLBACKTYPE(int, FNUSBTESTPARAMSSETUP,(unsigned idxTest, const char *pszTest, PUSBTESTPARAMS pParams));
    125125/** Pointer to a USB test parameters setup callback. */
    126126typedef FNUSBTESTPARAMSSETUP *PFNUSBTESTPARAMSSETUP;
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