In libuv
file heap-inl.h, I see the following macro
#if defined(__GNUC__)
# define HEAP_EXPORT(declaration) __attribute__((unused)) static declaration
...
HEAP_EXPORT(void heap_init(struct heap* heap));
...
heap-inl.h
is included in a source file loop.c
that then uses the declared function heap_init
.
From what I interpret...
heap-inl.h
stands for heap "inline"?HEAP_EXPORT
is exporting a function to be used by other source files.
What I don't understand is why an exported function is marked __attribute((unused))__
. Also, why is it also a static
declaration? I thought static
functions can only be used in the file it is defined in. Also, what does in-lining have to do with any of this?