0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-09-28 19:58:53 +02:00

ircd::mapi: Cleanup macros for potential deepbind strategy.

This commit is contained in:
Jason Volk 2019-05-02 16:23:56 -07:00
parent 154eee0ca6
commit a464523c00
2 changed files with 5 additions and 17 deletions

View file

@ -12,44 +12,32 @@
#define HAVE_IRCD_MAPI_H
#define IRCD_MODULE_HEADER_SYMBOL_NAME "ircd_module"
#define IRCD_MODULE_IMPL_VISIBILITY "protected"
#define IRCD_MODULE_EXPORT_CODE_SECTION "ircd.code"
#define IRCD_MODULE_EXPORT_CODE_VISIBILITY "default"
#define IRCD_MODULE_EXPORT_DATA_SECTION "ircd.data"
#define IRCD_MODULE_EXPORT_DATA_VISIBILITY "default"
/// Macro of decorations used on function definitions in modules which are
/// loaded with RTLD_GLOBAL. These function definitions implement some decl
/// in the include/ircd/* headers; the decl is a weak unresolved symbol.
#define IRCD_MODULE_IMPL \
__attribute__((visibility(IRCD_MODULE_IMPL_VISIBILITY)))
/// Macro of decorations used on function definitions in modules which are
/// published for demangling and use by libircd. This is used in modules
/// which are loaded with RTLD_LOCAL where the function is manually imported
/// with the ircd::mods system.
/// published for demangling and use by libircd.
#define IRCD_MODULE_EXPORT_CODE \
__attribute__((section(IRCD_MODULE_EXPORT_CODE_SECTION))) \
__attribute__((visibility(IRCD_MODULE_EXPORT_CODE_VISIBILITY)))
/// Macro of decorations used on object definitions in modules which are
/// published for demangling and use by libircd. This is the object equivalent
/// of IRCD_MODULE_EXPORT_CODE (see docs).
/// published for demangling and use by libircd (object equivalent).
#define IRCD_MODULE_EXPORT_DATA \
__attribute__((section(IRCD_MODULE_EXPORT_DATA_SECTION))) \
__attribute__((visibility(IRCD_MODULE_EXPORT_CODE_VISIBILITY))) \
__attribute__((externally_visible))
// Common convenience aliases
#define IRCD_MODULE_EXPORT IRCD_MODULE_EXPORT_CODE
#define IRCD_EXPORT IRCD_MODULE_EXPORT
#define IRCD_IMPL IRCD_MODULE_IMPL
#define IRCD_MODULE_EXPORT \
IRCD_MODULE_EXPORT_CODE
/// Module declaration
#define IRCD_MODULE \
__attribute__((visibility("default"))) \
__attribute__((externally_visible)) \
__attribute__((weak)) \
ircd_module
/// Module API: Interface for module developers.

View file

@ -851,7 +851,7 @@ try
static const load_mode::type flags
{
load_mode::rtld_local |
load_mode::rtld_lazy
load_mode::rtld_now
};
// Search for loaded module and increment the reference counter for this handle if loaded.