>>>> "kkm" == Kirill 'Big K' Katsnelson
<kkm(a)dtmx.com> writes:
kkm> Some time ago, Martin Buchholz wrote...
> 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'.
kkm> MSVC has `__inline' but no `inline'. This means that I'll have to put
kkm> #define inline __inline
kkm> in the s/ file. Is it clean? I think yes, just what do you think about this.
I agree.
You'll also need to define INLINE (to be renamed INLINE_HEADER very
soon). It is very likely that
#define INLINE static inline
will work. But if there is a mechanism like gcc's for having
non-inlined inline functions defined externally, that could be used to
avoid generating multiple function bodies if an inline function is not
inlined (e.g. during debugging). This is purely an object code size
optimization, however - the suggested definition for INLINE will very
likely work, and will work very well when optimizing.
Whatever you do, try to test with C and C++.
Martin