Fix building res_crypto on systems that init locks with constructors.
authorRussell Bryant <russell@russellbryant.com>
Sun, 5 Aug 2007 03:14:24 +0000 (03:14 +0000)
committerRussell Bryant <russell@russellbryant.com>
Sun, 5 Aug 2007 03:14:24 +0000 (03:14 +0000)
The problem was that res_crypto now has a RWLIST named "keys".  The macro
for defining this list defines a function used as a constructor for the list
called "init_keys".  However, there was another function called init_keys in
this module for a CLI command.  The fix is just to prepend the generated
functions with underscores.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@78138 65c4cc65-6c06-0410-ace0-fbb531ad65f3

include/asterisk/linkedlists.h

index fdf31c0..257a468 100644 (file)
@@ -248,11 +248,11 @@ struct name {                                                             \
        struct type *last;                                              \
        ast_mutex_t lock;                                               \
 } name;                                                                        \
-static void  __attribute__ ((constructor)) init_##name(void)           \
+static void  __attribute__ ((constructor)) __init_##name(void)         \
 {                                                                      \
         AST_LIST_HEAD_INIT(&name);                                     \
 }                                                                      \
-static void  __attribute__ ((destructor)) fini_##name(void)            \
+static void  __attribute__ ((destructor)) __fini_##name(void)          \
 {                                                                      \
         AST_LIST_HEAD_DESTROY(&name);                                  \
 }                                                                      \
@@ -290,11 +290,11 @@ struct name {                                                           \
         struct type *last;                                              \
         ast_rwlock_t lock;                                              \
 } name;                                                                 \
-static void  __attribute__ ((constructor)) init_##name(void)            \
+static void  __attribute__ ((constructor)) __init_##name(void)          \
 {                                                                       \
         AST_RWLIST_HEAD_INIT(&name);                                    \
 }                                                                       \
-static void  __attribute__ ((destructor)) fini_##name(void)             \
+static void  __attribute__ ((destructor)) __fini_##name(void)           \
 {                                                                       \
         AST_RWLIST_HEAD_DESTROY(&name);                                 \
 }                                                                       \