mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 11:25:35 +00:00
Modules: Make ast_module_info->self available to auxiliary sources.
ast_module_info->self is often needed to register items with the core. Many modules have ad-hoc code to make this pointer available to auxiliary sources. This change updates the module build process to make the needed information available to all sources in a module. ASTERISK-25056 #close Reported by: Corey Farrell Change-Id: I18c8cd58fbcb1b708425f6757becaeca9fa91815
This commit is contained in:
@@ -271,4 +271,21 @@ struct ast_sched_context;
|
||||
#define __stringify_1(x) #x
|
||||
#define __stringify(x) __stringify_1(x)
|
||||
|
||||
#if defined(AST_IN_CORE) \
|
||||
|| (!defined(AST_MODULE_SELF_SYM) \
|
||||
&& (defined(STANDALONE) || defined(STANDALONE2) || defined(AST_NOT_MODULE)))
|
||||
|
||||
#define AST_MODULE_SELF NULL
|
||||
|
||||
#elif defined(AST_MODULE_SELF_SYM)
|
||||
|
||||
/*! Retreive the 'struct ast_module *' for the current module. */
|
||||
#define AST_MODULE_SELF AST_MODULE_SELF_SYM()
|
||||
|
||||
struct ast_module;
|
||||
/* Internal/forward declaration, AST_MODULE_SELF should be used instead. */
|
||||
struct ast_module *AST_MODULE_SELF_SYM(void);
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* _ASTERISK_H */
|
||||
|
Reference in New Issue
Block a user