No, for inline
in particular, these should not be the same.
But the example is wrong from the start. For inline
you need a definition (the whole function) with the inline
in the .h file. By that, the inline
, you avoid that the symbol is defined in several translation unit (.c) where you include the .h header.
Then, in exactly one translation unit you pout just the declaration without inline
to indicate that the symbol should be generated in the corresponding .o object file.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…