#ifndef _IT_IFUNC_H #define _IT_IFUNC_H //! ifunc helpers #define IFUNC_NAME(name, ver) _impl__ ## name ## __ ## ver #define IFUNC_IMPL(name, ver) __attribute__((copy(name))) IFUNC_NAME(name, ver) #define IFUNC_RESOLVER_A(attr, name) __attribute__((returns_nonnull)) (* __attribute__(attr) _ifun__ ## name (void)) // When the ifunc resolver wants to return a function pointer that has attributes on it, the attribute inner list (e.g. `(returns_nonnull, const, nonnull)') can be provided as the first argument #define IFUNC_RESOLVER(name) IFUNC_RESOLVER_A((copy(name)), name) #define IFUNC_DEF(name, params) name params __attribute__((__ifunc__("_ifun__" #name))) #endif /* _IT_IFUNC_H */