What is exactly your problem? Can you give examples?
The real inlining is of course done by the C compiler, maybe your one is too weak. And using Link Time Optimization LTO can give even better inlining. GCC and clang support -flto flag, where clang needed gold linker for that in the past.
