VirtualBox

Changeset 19819 in vbox for trunk/include/iprt


Ignore:
Timestamp:
May 19, 2009 12:47:07 PM (16 years ago)
Author:
vboxsync
Message:

iprt/cdefs.h: DECL_FORCE_INLINE and DECL_NO_INLINE.

File:
1 edited

Legend:

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

    r19755 r19819  
    654654#else
    655655# define DECLINLINE(type) inline type
     656#endif
     657
     658
     659/** @def DECL_FORCE_INLINE
     660 * How to declare a function as inline and try convince the compiler to always
     661 * inline it regardless of optimization switches.
     662 * @param   type    The return type of the function declaration.
     663 * @remarks Use sparsely and with care. Don't use this macro on C++ methods.
     664 */
     665#ifdef __GNUC__
     666# define DECL_FORCE_INLINE(type)    __attribute__((always_inline)) DECLINLINE(type)
     667#elif defined(_MSC_VER)
     668# define DECL_FORCE_INLINE(type)    __forceinline type
     669#else
     670# define DECL_FORCE_INLINE(type)    DECLINLINE(type)
     671#endif
     672
     673
     674/** @def DECL_NO_INLINE
     675 * How to declare a function telling the compiler not to inline it.
     676 * @param   scope   The function scope, static or RT_NOTHING.
     677 * @param   type    The return type of the function declaration.
     678 * @remarks Don't use this macro on C++ methods.
     679 */
     680#ifdef __GNUC__
     681# define DECL_NO_INLINE(scope,type) __attribute__((noinline)) scope type
     682#elif defined(_MSC_VER)
     683# define DECL_NO_INLINE(scope,type) __declspec(noline) scope type
     684#else
     685# define DECL_NO_INLINE(scope,type) scope type
    656686#endif
    657687
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