VirtualBox

Changeset 57336 in vbox for trunk/include/iprt/cdefs.h


Ignore:
Timestamp:
Aug 13, 2015 10:17:35 PM (9 years ago)
Author:
vboxsync
Message:

iprt/cdefs.h,PGMDbg.cpp: Align DECLASM and DECLCALLBACK (and the rest) so we won't get into trouble with newer gcc versions finally checking for compatible calling conventions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/cdefs.h

    r57004 r57336  
    950950/** @def RTCALL
    951951 * The standard calling convention for the Runtime interfaces.
     952 *
     953 * @remarks The regparm(0) in the X86/GNUC variant deals with -mregparm=x use in
     954 *          the linux kernel and potentially elsewhere (3rd party).
    952955 */
    953956#ifdef _MSC_VER
    954 # define RTCALL     __cdecl
     957# define RTCALL                 __cdecl
    955958#elif defined(RT_OS_OS2)
    956 # define RTCALL     __cdecl
    957 #elif defined(__GNUC__) && defined(IN_RING0) && defined(RT_ARCH_X86) /** @todo consider dropping IN_RING0 here. */
    958 # define RTCALL     __attribute__((cdecl,regparm(0))) /* regparm(0) deals with -mregparm=x use in the linux kernel. */
     959# define RTCALL                 __cdecl
     960#elif defined(__GNUC__) && defined(RT_ARCH_X86)
     961# define RTCALL                 __attribute__((cdecl,regparm(0)))
    959962#else
    960963# define RTCALL
     
    10241027 */
    10251028#ifdef __cplusplus
    1026 # if defined(_MSC_VER) || defined(RT_OS_OS2)
    1027 #  define DECLASM(type)          extern "C" type __cdecl
    1028 # elif defined(__GNUC__) && defined(RT_ARCH_X86)
    1029 #  define DECLASM(type)          extern "C" type __attribute__((cdecl,regparm(0)))
    1030 # else
    1031 #  define DECLASM(type)          extern "C" type
    1032 # endif
    1033 #else
    1034 # if defined(_MSC_VER) || defined(RT_OS_OS2)
    1035 #  define DECLASM(type)          type __cdecl
    1036 # elif defined(__GNUC__) && defined(RT_ARCH_X86)
    1037 #  define DECLASM(type)          type __attribute__((cdecl,regparm(0)))
    1038 # else
    1039 #  define DECLASM(type)          type
    1040 # endif
     1029# define DECLASM(type)           extern "C" type RTCALL
     1030#else
     1031# define DECLASM(type)           type RTCALL
    10411032#endif
    10421033
     
    10451036 * @param   type    The return type of the function.
    10461037 */
    1047 # if defined(_MSC_VER) || defined(RT_OS_OS2)
    1048 # define DECLASMTYPE(type)      type __cdecl
    1049 #else
    1050 # define DECLASMTYPE(type)      type
    1051 #endif
     1038#define DECLASMTYPE(type)       type RTCALL
    10521039
    10531040/** @def DECLNORETURN
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