all.
I want to link a library which calls malloc()
function.
However, my target environment is different one and
malloc()
is supplied as inline-function.
How can I make the library's call to malloc()
direct to
my target environment's malloc()
routine?
Is it any way to change the exported function name? If so
I can code my_malloc()
first and export it as malloc()
and link
the library to that one:
#include <my_environment.h> // malloc() is inline function declared there
void my_malloc (void) {
malloc (void);
}
More specifically,
the library is one from linux distro so it depends on libc.
But my environment is embedded one and has no libc library and malloc()
, free()
, ... are custom-implemented. Some are inline functions and some are library functions.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…