Summary: | ASTERISK-10409: AST_MODULE_INFO macro with wrong parameter order for c++ code modules.h | ||
Reporter: | AlessandroBM (alebm) | Labels: | |
Date Opened: | 2007-09-28 13:18:19 | Date Closed: | 2007-09-30 14:48:02 |
Priority: | Minor | Regression? | No |
Status: | Closed/Complete | Components: | Addons/General |
Versions: | Frequency of Occurrence | ||
Related Issues: | |||
Environment: | Attachments: | ||
Description: | AST_MODULE_INFO is define as #define AST_MODULE_INFO(keystr, flags_to_set, desc, load_func, unload_func, reload_func) \ static struct ast_module_info __mod_info = { \ NULL, \ load_func, \ unload_func, \ reload_func, \ AST_MODULE, \ desc, \ keystr, \ flags_to_set \ }; \ for c++ code, but the struct ast_module_info is defined as struct ast_module_info { struct ast_module *self; enum ast_module_load_result (*load)(void); int (*reload)(void); int (*unload)(void); const char *name; const char *description; const char *key; unsigned int flags; }; the unload_func/reload_func are swaped in the macro definition ****** ADDITIONAL INFORMATION ****** patched code: --- include\asterisk\module.h (1) +++ include\asterisk\module.h (2) @@ -221,14 +221,14 @@ #if defined(__cplusplus) || defined(c_plusplus) #define AST_MODULE_INFO(keystr, flags_to_set, desc, load_func, unload_func, reload_func) \ static struct ast_module_info __mod_info = { \ NULL, \ load_func, \ - unload_func, \ reload_func, \ + unload_func, \ AST_MODULE, \ desc, \ keystr, \ flags_to_set \ }; \ static void __attribute__ ((constructor)) __reg_module(void) \ | ||
Comments: | By: Digium Subversion (svnbot) 2007-09-30 14:43:20 Repository: asterisk Revision: 84146 ------------------------------------------------------------------------ r84146 | russell | 2007-09-30 14:43:17 -0500 (Sun, 30 Sep 2007) | 4 lines Fix the AST_MODULE_INFO macro for C++ modules. The load and reload parameters were in the wrong place. (closes issue ASTERISK-10409, alebm) ------------------------------------------------------------------------ By: Digium Subversion (svnbot) 2007-09-30 14:48:02 Repository: asterisk Revision: 84147 ------------------------------------------------------------------------ r84147 | russell | 2007-09-30 14:48:00 -0500 (Sun, 30 Sep 2007) | 12 lines Merged revisions 84146 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r84146 | russell | 2007-09-30 16:02:16 -0400 (Sun, 30 Sep 2007) | 4 lines Fix the AST_MODULE_INFO macro for C++ modules. The load and reload parameters were in the wrong place. (closes issue ASTERISK-10409, alebm) ........ ------------------------------------------------------------------------ _U trunk/ U trunk/include/asterisk/module.h |