Martin Buchholz <martin(a)xemacs.org> writes:
Hrvoje> I've been told that in C++ `inline' means `static
inline'.
Hrvoje> Do all C++ compilers grok `static inline'?
In standard C++, `inline' does not affect the extern-ness of a
function.
I have been misinformed, then; good. (I think the information came
from Ben, but I could be wrong.)
If different translations units have definitions for an external
inline function, they must be identical. Older C++ implementations
considered `extern inline' illegal. I guess that adds to the number
of distinct inline implementations - we're up to 6 now!
We can conclude that inline in headers sucks. Macros rule and we
should have more of them.
(The above was of course a joke.)
Hrvoje> it's especially important to *document* what it means.
The
Hrvoje> annoying thing about the INLINE confusion is that it crops
Hrvoje> up time and again, by different people and with different
Hrvoje> code.
OK. I'm convinced. I'll implement this, if there are no further
objections.
Again, the proposal:
1. Rename INLINE to INLINE_HEADER.
2. Document the two approved ways of creating inline functions - in
.h files, using INLINE_HEADER, and in .c files, using `static inline'.
That's it.