Message ID | 20140916102016.GM6586@spoyarek.pnq.redhat.com |
---|---|
State | New |
Headers | show |
On Tue, Sep 16, 2014 at 03:50:16PM +0530, Siddhesh Poyarekar wrote: > [1] https://sourceware.org/ml/libc-alpha/2012-12/msg00306.html > > [BZ #17266] > * misc/sys/cdefs.h [!defined __extern_always_inline && defined > __clang__]: Define __extern_always_inline and __extern_inline > for clang++. > > diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h > index d8ee73c..20b2483 100644 > --- a/misc/sys/cdefs.h > +++ b/misc/sys/cdefs.h > @@ -330,6 +330,20 @@ > # endif > #endif > > +/* clang++ identifies itself as gcc-4.2, but has support for GNU inlining > + semantics, that can be checked fot by using the __GNUC_STDC_INLINE_ and > + __GNUC_GNU_INLINE__ macro definitions. */ s/fot/for/; why are you using a separate hunk for clang instead of using the earlier one? > +#if !defined __extern_always_inline && defined __clang__ > +# if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__ > +# define __extern_inline extern __inline __attribute__ ((__gnu_inline__)) > +# define __extern_always_inline \ > + extern __always_inline __attribute__ ((__gnu_inline__)) > +# else > +# define __extern_inline extern __inline > +# define __extern_always_inline extern __always_inline This doesn't look right. If you have clang that doesn't have gnu_inline support, in C++ extern __inline definitely is not the right semantics. You don't want to define the macros then. I'd say you want to change: #if !defined __cplusplus || __GNUC_PREREQ (4,3) to: #if !defined __cplusplus || __GNUC_PREREQ (4,3) \ || (defined __clang__ && (defined __GNUC_STDC_INLINE__ \ || defined __GNUC_GNU_INLINE__)) Jakub
diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h index d8ee73c..20b2483 100644 --- a/misc/sys/cdefs.h +++ b/misc/sys/cdefs.h @@ -330,6 +330,20 @@ # endif #endif +/* clang++ identifies itself as gcc-4.2, but has support for GNU inlining + semantics, that can be checked fot by using the __GNUC_STDC_INLINE_ and + __GNUC_GNU_INLINE__ macro definitions. */ +#if !defined __extern_always_inline && defined __clang__ +# if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__ +# define __extern_inline extern __inline __attribute__ ((__gnu_inline__)) +# define __extern_always_inline \ + extern __always_inline __attribute__ ((__gnu_inline__)) +# else +# define __extern_inline extern __inline +# define __extern_always_inline extern __always_inline +# endif +#endif + #ifdef __extern_always_inline # define __fortify_function __extern_always_inline __attribute_artificial__ #endif