VirtualBox

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/common/fuzz
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/fuzz/fuzz.cpp

    r83426 r85121  
    5151
    5252
     53/*********************************************************************************************************************************
     54*   Defined Constants And Macros                                                                                                 *
     55*********************************************************************************************************************************/
    5356#define RTFUZZCTX_MAGIC UINT32_C(0xdeadc0de) /** @todo */
    5457
     
    9699 * @param   ppMutation          Where to store the created mutation on success.
    97100 */
    98 typedef DECLCALLBACK(int) FNRTFUZZCTXMUTATORPREP(PRTFUZZCTXINT pThis, uint64_t offStart, PRTFUZZMUTATION pMutationParent,
    99                                                  PPRTFUZZMUTATION ppMutation);
     101typedef DECLCALLBACKTYPE(int, FNRTFUZZCTXMUTATORPREP,(PRTFUZZCTXINT pThis, uint64_t offStart, PRTFUZZMUTATION pMutationParent,
     102                                                      PPRTFUZZMUTATION ppMutation));
    100103/** Pointer to a mutator preparation callback. */
    101104typedef FNRTFUZZCTXMUTATORPREP *PFNRTFUZZCTXMUTATORPREP;
     
    112115 * @param   cbBuf               Size of the remaining buffer.
    113116 */
    114 typedef DECLCALLBACK(int) FNRTFUZZCTXMUTATOREXEC(PRTFUZZCTXINT pThis, PCRTFUZZMUTATION pMutation, const void *pvMutation,
    115                                                  uint8_t *pbBuf, size_t cbBuf);
     117typedef DECLCALLBACKTYPE(int, FNRTFUZZCTXMUTATOREXEC,(PRTFUZZCTXINT pThis, PCRTFUZZMUTATION pMutation, const void *pvMutation,
     118                                                      uint8_t *pbBuf, size_t cbBuf));
    116119/** Pointer to a mutator execution callback. */
    117120typedef FNRTFUZZCTXMUTATOREXEC *PFNRTFUZZCTXMUTATOREXEC;
     
    128131 * @param   pvUser              Opaque user data to pass to the export callback.
    129132 */
    130 typedef DECLCALLBACK(int) FNRTFUZZCTXMUTATOREXPORT(PRTFUZZCTXINT pThis, PCRTFUZZMUTATION pMutation, const void *pvMutation,
    131                                                    PFNRTFUZZCTXEXPORT pfnExport, void *pvUser);
     133typedef DECLCALLBACKTYPE(int, FNRTFUZZCTXMUTATOREXPORT,(PRTFUZZCTXINT pThis, PCRTFUZZMUTATION pMutation, const void *pvMutation,
     134                                                        PFNRTFUZZCTXEXPORT pfnExport, void *pvUser));
    132135/** Pointer to a mutator export callback. */
    133136typedef FNRTFUZZCTXMUTATOREXPORT *PFNRTFUZZCTXMUTATOREXPORT;
     
    144147 * @param   pvUser              Opaque user data to pass to the import callback.
    145148 */
    146 typedef DECLCALLBACK(int) FNRTFUZZCTXMUTATORIMPORT(PRTFUZZCTXINT pThis, PCRTFUZZMUTATION pMutation, void *pvMutation,
    147                                                    PFNRTFUZZCTXIMPORT pfnImport, void *pvUser);
     149typedef DECLCALLBACKTYPE(int, FNRTFUZZCTXMUTATORIMPORT,(PRTFUZZCTXINT pThis, PCRTFUZZMUTATION pMutation, void *pvMutation,
     150                                                        PFNRTFUZZCTXIMPORT pfnImport, void *pvUser));
    148151/** Pointer to a mutator import callback. */
    149152typedef FNRTFUZZCTXMUTATORIMPORT *PFNRTFUZZCTXMUTATORIMPORT;
  • trunk/src/VBox/Runtime/common/fuzz/fuzzclientcmd.cpp

    r82968 r85121  
    4646
    4747
    48 
    49 typedef DECLCALLBACK(int) FNLLVMFUZZERTESTONEINPUT(const uint8_t *pbData, size_t cbData);
     48/*********************************************************************************************************************************
     49*   Structures and Typedefs                                                                                                      *
     50*********************************************************************************************************************************/
     51typedef DECLCALLBACKTYPE(int, FNLLVMFUZZERTESTONEINPUT,(const uint8_t *pbData, size_t cbData));
    5052typedef FNLLVMFUZZERTESTONEINPUT *PFNLLVMFUZZERTESTONEINPUT;
    5153
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