On Fri, Apr 13, 2012 at 08:46:33AM -0700, Khem Raj wrote:
> Static inline wont work on packages like gnulib
> where it will generate its own spawn.h

Not only that; it violates the standard in countless other ways. For
example, the address of the functions will appear different in each
translation unit. It's valid to use inline, but not static; however
this may be undesirable because the semantics are different in C++ and
old GNU C compilers (they do not conform to the C99 semantics of
inline).

A universally portable method is:

(1) declare extern prototype
(2) define static inline function with a different name (__ prefixed)
(3) #define name(args) __name(args)

Note that for trivial functions like this, the static inline function
can be skipped and the function body just included in the macro...

Rich
_______________________________________________
uClibc mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/uclibc

Reply via email to