VirtualBox

Changeset 39918 in vbox


Ignore:
Timestamp:
Jan 31, 2012 2:05:02 PM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
75993
Message:

improve r75830 (better Linux 3.3 compile fix)

File:
1 edited

Legend:

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

    r39890 r39918  
    110110#   endif
    111111#  endif
    112 #  if LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0) \
    113     || !defined(__cplusplus) \
    114     || !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) \
    115     || !defined(CONFIG_OPTIMIZE_INLINING)
    116    /* compiler-gcc.h redefines inline macrodefenitions when CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING and CONFIG_OPTIMIZED_INLINING
    117     * are defined appeding __attribute__((no_instrument_function)) which isn't supported by g++. inline used in linux/posix_types.h that
    118     * why we need include linux/type.h after compiler-gcc.h
    119     */
     112#  include <linux/compiler.h>
     113#  if defined(__cplusplus)
     114    /*
     115     * Starting with 3.3, <linux/compiler-gcc.h> appends 'notrace' (which
     116     * expands to __attribute__((no_instrument_function))) to inline,
     117     * __inline and __inline__. Revert that.
     118     */
     119#   undef inline
     120#   define inline inline
     121#   undef __inline__
     122#   define __inline__ __inline__
     123#   undef __inline
     124#   define __inline __inline
     125#  endif
    120126#  include <linux/types.h>
    121 #  endif
    122127#  include <linux/stddef.h>
    123128#  undef uintptr_t
     
    133138#    define __inline__ __inline__
    134139#   endif
    135 #  if LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0) \
    136     && defined(__cplusplus) \
    137     && defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) \
    138     && defined(CONFIG_OPTIMIZE_INLINING)
    139     /*
    140      * <linux/compiler-gcc.h> does when CONFIG_OPTIMIZE_INLINING and CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING
    141      * are defined and affects VBox c++ sources,
    142      *
    143      * define inline            inline          notrace
    144      * define __inline__        __inline__      notrace
    145      * define __inline          __inline        notrace
    146      *
    147      * upper in <linux/compiler-gcc.h>
    148      * #define notrace __attribute__((no_instrument_function))
    149      */
    150 #   undef inline
    151 #   define inline inline
    152 #   undef __inline__
    153 #   define __inline__ __inline__
    154 #   undef __inline
    155 #  define __inline __inline
    156 #  undef __always_inline
    157 #  define __always_inline __attribute__((always_inline))
    158 #  include <linux/types.h>
    159 #  endif /* KERNEL_VERSION(3.3.0)< */
    160140#  endif
    161141#  undef false
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