2 --- include/iprt/cdefs.h (revision 57336)
3 +++ include/iprt/cdefs.h (revision 57335)
7 * The standard calling convention for the Runtime interfaces.
9 - * @remarks The regparm(0) in the X86/GNUC variant deals with -mregparm=x use in
10 - * the linux kernel and potentially elsewhere (3rd party).
13 +# define RTCALL __cdecl
14 -# define RTCALL __cdecl
15 #elif defined(RT_OS_OS2)
16 +# define RTCALL __cdecl
17 +#elif defined(__GNUC__) && defined(IN_RING0) && defined(RT_ARCH_X86) /** @todo consider dropping IN_RING0 here. */
18 +# define RTCALL __attribute__((cdecl,regparm(0))) /* regparm(0) deals with -mregparm=x use in the linux kernel. */
19 -# define RTCALL __cdecl
20 -#elif defined(__GNUC__) && defined(RT_ARCH_X86)
21 -# define RTCALL __attribute__((cdecl,regparm(0)))
25 @@ -1026,9 +1023,21 @@
26 * @param type The return type of the function declaration.
29 +# if defined(_MSC_VER) || defined(RT_OS_OS2)
30 +# define DECLASM(type) extern "C" type __cdecl
31 +# elif defined(__GNUC__) && defined(RT_ARCH_X86)
32 +# define DECLASM(type) extern "C" type __attribute__((cdecl,regparm(0)))
34 +# define DECLASM(type) extern "C" type
36 -# define DECLASM(type) extern "C" type RTCALL
38 +# if defined(_MSC_VER) || defined(RT_OS_OS2)
39 +# define DECLASM(type) type __cdecl
40 +# elif defined(__GNUC__) && defined(RT_ARCH_X86)
41 +# define DECLASM(type) type __attribute__((cdecl,regparm(0)))
43 +# define DECLASM(type) type
45 -# define DECLASM(type) type RTCALL
49 @@ -1035,7 +1044,11 @@
50 * How to declare an internal assembly function type.
51 * @param type The return type of the function.
53 +# if defined(_MSC_VER) || defined(RT_OS_OS2)
54 +# define DECLASMTYPE(type) type __cdecl
56 +# define DECLASMTYPE(type) type
58 -#define DECLASMTYPE(type) type RTCALL
61 * How to declare a function which does not return.
63 --- src/VBox/VMM/VMMR3/PGMDbg.cpp (revision 57336)
64 +++ src/VBox/VMM/VMMR3/PGMDbg.cpp (revision 57335)
66 * @param cbNeedle Size of what we're searching for.
69 +#if defined(_MSC_VER) || defined(RT_OS_OS2)
70 +# define DECLASMCALLBACK(type) type __cdecl
71 +#elif defined(__GNUC__) && defined(RT_ARCH_X86)
72 +# define DECLASMCALLBACK(type) type __attribute__((cdecl,regparm(0)))
74 +# define DECLASMCALLBACK(type) type
76 +typedef DECLASMCALLBACK(uint8_t const *) FNPGMR3DBGFIXEDMEMSCAN(void const *pvHaystack, uint32_t cbHaystack,
77 + void const *pvNeedle, size_t cbNeedle);
78 -typedef DECLCALLBACK(uint8_t const *) FNPGMR3DBGFIXEDMEMSCAN(void const *pvHaystack, uint32_t cbHaystack,
79 - void const *pvNeedle, size_t cbNeedle);
80 /** Pointer to an fixed size and step assembly scanner function. */
81 typedef FNPGMR3DBGFIXEDMEMSCAN *PFNPGMR3DBGFIXEDMEMSCAN;