A function may be shadowed by a static inline
function or macro with
the same behavior. Typically, this allows better performance for C/C++.
To provide a static inline
equivalent to an exported function,
write something like:
.h
Header:
static inline returntype
_Py_Foo_impl(ARGS)
{
...
}
PyAPI_FUNC(returntype) Py_Foo (ARGS);
#define Py_Foo _Py_Foo_impl
.c
Code:
// at the end (after all calls to Py_Foo):
#undef Py_Foo
returntype
Py_Foo(ARGS)
{
return _Py_Foo_impl(ARGS);
}