Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Jun 2007 16:25:00 -0400
From:      John Baldwin <jhb@freebsd.org>
To:        Luigi Rizzo <rizzo@icir.org>
Cc:        current@freebsd.org, fabio@gandalf.sssup.it
Subject:   Re: 'static inline' vs macros for kernel functions ? (was how to handle name clashes in linux/freebsd kernel sources ?)
Message-ID:  <200706261625.00565.jhb@freebsd.org>
In-Reply-To: <20070626123130.A58530@xorpc.icir.org>
References:  <20070626040758.A48170@xorpc.icir.org> <20070626123130.A58530@xorpc.icir.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday 26 June 2007 03:31:30 pm Luigi Rizzo wrote:
> This is related to the post attached at the end of this email.
> 
> In this commit:
> 
>     CVS log for src/sys/sys/systm.h
>     Revision 1.252: download - view: text, markup, annotated - select for 
diffs
>     Fri Mar 9 22:41:01 2007 UTC (3 months, 2 weeks ago) by jhb
> 
> msleep() changed from a function to a macro wrapping _sleep().
> 
> Being a macro, it is a lot harder to hide it in case of name clashes
> such as the one mentioned below.
> 
> This raises the question - what is the point in using macros
> in cases like this where we could use static inline function and
> probably even exploit better compiler checks ?
> 
> Would it be possible to revert msleep() to a real function ?

FreeBSD already uses macros all over the place in sys/*.h.  Go duke it out 
with bde@. :)  You can always #undef msleep and redefine it to something 
else.

-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200706261625.00565.jhb>