VirtualBox

Changeset 85121 in vbox for trunk/src/VBox/Storage/testcase


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/Storage/testcase
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Storage/testcase/VDIoBackend.h

    r82968 r85121  
    4444 * @param   rcReq     Completion code for the request.
    4545 */
    46 typedef DECLCALLBACK(int) FNVDIOCOMPLETE(void *pvUser, int rcReq);
     46typedef DECLCALLBACKTYPE(int, FNVDIOCOMPLETE,(void *pvUser, int rcReq));
    4747/** Pointer to a completion handler. */
    4848typedef FNVDIOCOMPLETE *PFNVDIOCOMPLETE;
  • trunk/src/VBox/Storage/testcase/VDIoBackendMem.h

    r82968 r85121  
    3939 * @param   rcReq     Completion code for the request.
    4040 */
    41 typedef DECLCALLBACK(int) FNVDIOCOMPLETE(void *pvUser, int rcReq);
     41typedef DECLCALLBACKTYPE(int, FNVDIOCOMPLETE,(void *pvUser, int rcReq));
    4242/** Pointer to a completion handler. */
    4343typedef FNVDIOCOMPLETE *PFNVDIOCOMPLETE;
  • trunk/src/VBox/Storage/testcase/VDScript.h

    r82968 r85121  
    8383
    8484/** Script callback. */
    85 typedef DECLCALLBACK(int) FNVDSCRIPTCALLBACK(PVDSCRIPTARG paScriptArgs, void *pvUser);
     85typedef DECLCALLBACKTYPE(int, FNVDSCRIPTCALLBACK,(PVDSCRIPTARG paScriptArgs, void *pvUser));
    8686/** Pointer to a script callback. */
    8787typedef FNVDSCRIPTCALLBACK *PFNVDSCRIPTCALLBACK;
     
    127127 * @param   cbRead         How much to read.
    128128 */
    129 typedef DECLCALLBACK(int) FNVDSCRIPTASREAD(void *pvUser, VDSCRIPTARG Address, void *pvBuf, size_t cbRead);
     129typedef DECLCALLBACKTYPE(int, FNVDSCRIPTASREAD,(void *pvUser, VDSCRIPTARG Address, void *pvBuf, size_t cbRead));
    130130/** Pointer to a read callback. */
    131131typedef FNVDSCRIPTASREAD *PFNVDSCRIPTASREAD;
     
    141141 * @param   cbWrite        How much to write.
    142142 */
    143 typedef DECLCALLBACK(int) FNVDSCRIPTASWRITE(void *pvUser, VDSCRIPTARG Address, const void *pvBuf, size_t cbWrite);
     143typedef DECLCALLBACKTYPE(int, FNVDSCRIPTASWRITE,(void *pvUser, VDSCRIPTARG Address, const void *pvBuf, size_t cbWrite));
    144144/** Pointer to a write callback. */
    145145typedef FNVDSCRIPTASWRITE *PFNVDSCRIPTASWRITE;
  • trunk/src/VBox/Storage/testcase/tstVD.cpp

    r82968 r85121  
    362362}
    363363
    364 static int compareSegments(const void *left, const void *right)
     364static int compareSegments(const void *left, const void *right) RT_NOTHROW_DEF
    365365{
    366366    /* Note that no duplicates are allowed in the array being sorted. */
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette