diff options
-rw-r--r-- | include/asterisk.h | 20 | ||||
-rw-r--r-- | main/pbx_builtins.c | 2 | ||||
-rw-r--r-- | main/pbx_functions.c | 2 |
3 files changed, 22 insertions, 2 deletions
diff --git a/include/asterisk.h b/include/asterisk.h index c501c44ce..873ed5c34 100644 --- a/include/asterisk.h +++ b/include/asterisk.h @@ -222,6 +222,9 @@ char *ast_complete_source_filename(const char *partial, int n); * SVN from modifying them in this file; under normal circumstances they would * not be present and SVN would expand the Revision keyword into the file's * revision number. + * + * \deprecated All new files should use ASTERISK_REGISTER_FILE instead. + * \version 11.22.0 deprecated */ #ifdef MTX_PROFILE #define HAVE_MTX_PROFILE /* used in lock.h */ @@ -251,6 +254,23 @@ char *ast_complete_source_filename(const char *partial, int n); #define ASTERISK_FILE_VERSION(file, x) #endif /* LOW_MEMORY */ +/*! + * \since 11.22.0 + * \brief Register/unregister a source code file with the core. + * + * This macro will place a file-scope constructor and destructor into the + * source of the module using it; this will cause the file to be + * registered with the Asterisk core (and unregistered) at the appropriate + * times. + * + * Example: + * + * \code + * ASTERISK_REGISTER_FILE() + * \endcode + */ +#define ASTERISK_REGISTER_FILE() ASTERISK_FILE_VERSION(__FILE__, NULL) + #if !defined(LOW_MEMORY) /*! * \brief support for event profiling diff --git a/main/pbx_builtins.c b/main/pbx_builtins.c index ce5a92b97..fa155888a 100644 --- a/main/pbx_builtins.c +++ b/main/pbx_builtins.c @@ -29,7 +29,7 @@ #include "asterisk.h" -ASTERISK_FILE_VERSION(__FILE__, "$Revision$") +ASTERISK_REGISTER_FILE() #include "asterisk/_private.h" #include "asterisk/pbx.h" diff --git a/main/pbx_functions.c b/main/pbx_functions.c index b8be2bc40..bc738b043 100644 --- a/main/pbx_functions.c +++ b/main/pbx_functions.c @@ -29,7 +29,7 @@ #include "asterisk.h" -ASTERISK_FILE_VERSION(__FILE__, "$Revision$") +ASTERISK_REGISTER_FILE() #include "asterisk/_private.h" #include "asterisk/cli.h" |