On Wednesday 02 October 2002 23.32, Robert Collins wrote:
> If the code is in a header and can inline, gcc doesn't care whether
> it will be part of a library or not. (This goes for gcc and g++).
Guideline on how to use inline in a manner that works for all/most
compilers
Any inlined functions in header files should be declared using
#ifndef MODULEID_INLINE
#define MODULEID_INLINE extern_inline
#endif
MODULEID_INLINE function(...)
{
...
}
Local functions within the same source file using
static inline function(...)
{
}
For each "extern inline" there must be one object file where the
function is declared without extern
#define MODULEID_INLINE inline
or alternatively
#define MODULEID_INLINE
before the #include ...
Regards
Henrik
Received on Thu Oct 03 2002 - 01:09:14 MDT
This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:16:52 MST