Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: -current's /usr/include/sys/lwp.h causes compile problems in pkgsrc



On Sun, Nov 29, 2009 at 03:42:34PM +0100, Tobias Nygren wrote:
 > > Anybody knows how to solve this?
 > 
 > Something like this?
 > 
 > [...]
 > -static inline void *
 > +#ifdef __GNUC__
 > +static __inline__ void *
 > +#else
 > +static void *
 > +#endif
 >  lwp_getpcb(struct lwp *l)

I must say I'm not entirely enthusiastic about that. :-/

We should have something in sys/cdefs.h for inline functions anyway;
perhaps an expanded form of what's currently in games/sail/inlinedefs.h,
along the lines of:

#if defined(__GNUC__) && !defined(__GNUC_STDC_INLINE__)
/* gcc's non-C99 inline semantics */
#define __nb_inline   extern __inline__

#elif defined(__STDC__) && __STDC_VERSION__ >= 199901L
/* C99 */
#define __nb_inline   inline

#elif defined(__GNUC__)
/* not sure if this case really exists */
#define __nb_inline   static __inline__

#else
/* something else; static inline is safest */
#define __nb_inline   static inline

#endif

I'm not especially attached to the symbol "__nb_inline". Suggestions?

-- 
David A. Holland
dholland%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index