VirtualBox

Changeset 85121 in vbox for trunk/src/VBox/Runtime/generic


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/Runtime/generic
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/generic/env-generic.cpp

    r82968 r85121  
    121121
    122122    /** The compare function we're using. */
    123     DECLCALLBACKMEMBER(int, pfnCompare)(const char *psz1, const char *psz2, size_t cchMax);
     123    DECLCALLBACKMEMBER(int, pfnCompare,(const char *psz1, const char *psz2, size_t cchMax));
    124124} RTENVINTERNAL, *PRTENVINTERNAL;
    125125
  • trunk/src/VBox/Runtime/generic/ftp-server.cpp

    r84509 r85121  
    268268
    269269/** Function pointer declaration for a specific FTP server command handler. */
    270 typedef DECLCALLBACK(int) FNRTFTPSERVERCMD(PRTFTPSERVERCLIENT pClient, uint8_t cArgs, const char * const *apcszArgs);
     270typedef DECLCALLBACKTYPE(int, FNRTFTPSERVERCMD,(PRTFTPSERVERCLIENT pClient, uint8_t cArgs, const char * const *apcszArgs));
    271271/** Pointer to a FNRTFTPSERVERCMD(). */
    272272typedef FNRTFTPSERVERCMD *PFNRTFTPSERVERCMD;
  • trunk/src/VBox/Runtime/generic/http-curl.cpp

    r85000 r85121  
    28602860 * cURL callback for reporting progress, we use it for checking for abort.
    28612861 */
    2862 static int rtHttpProgress(void *pData, double rdTotalDownload, double rdDownloaded, double rdTotalUpload, double rdUploaded)
     2862static int rtHttpProgress(void *pData, double rdTotalDownload, double rdDownloaded, double rdTotalUpload, double rdUploaded) RT_NOTHROW_DEF
    28632863{
    28642864    PRTHTTPINTERNAL pThis = (PRTHTTPINTERNAL)pData;
     
    30823082 * cURL callback for writing body data.
    30833083 */
    3084 static size_t rtHttpWriteBodyData(char *pchBuf, size_t cbUnit, size_t cUnits, void *pvUser)
     3084static size_t rtHttpWriteBodyData(char *pchBuf, size_t cbUnit, size_t cUnits, void *pvUser) RT_NOTHROW_DEF
    30853085{
    30863086    PRTHTTPINTERNAL   pThis      = (PRTHTTPINTERNAL)pvUser;
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